How to get the Page Name of the current page?

After many attempts and help from others, I finally got a solution to my problem. That’s the code I used:

<?php 

      
     if ( is_front_page() ) {
         echo "Startseite";
     } elseif ( is_singular("project") ) {
         echo "Projekte";
     } elseif ( get_the_title() == "Datenschutz" ) {
         echo "Datenschutz";
     } elseif ( get_the_title() == "Impressum" ) {
         echo "Impressum";
     } elseif ( get_the_title() == "Contact" ) {
         echo "Kontakt";
     } elseif ( get_post_type() == "project" ) {
         echo "Projekte";
     } elseif ( is_single() || is_home() ) {
         echo "Blog";
     }
      
  ?>