$("#header").click(function() {
const currentText = $(this).text(); // один раз, и в константу
let html;
if (currentText === "Hello! Play with me!")) {
html = "0 - click again!1";
} else if (currentText === "0 - click again!1")) {
html = "1 - click again!1";
} else if (currentText === "1 - click again!1")) {
html = "2 - click again!1";
} else if (currentText === "2 - click again!1")) {
html = "3 - click again!1";
}
$("#header").html(html);
});