//id of post/page
$pid = $_GET['pid'];

// Exit When post id not defined
if ($pid == '') {
         wp_redirect(home_url('/not_found'));
         exit;
       }

WordPress loop

$args = array(
        'post__in' => array($pid),
        'post_type' => 'post',
          );
          $the_query = new WP_Query($args);
          $comments_count = wp_count_comments($pid);
          
          while ($the_query->have_posts()) : $the_query->the_post();

               //Display post thubnail
               $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($pid), 'full') 
               <img src="<?= $thumb[0] ?>" alt="">
               the_title();

               //Get Author Name
               get_the_author();
               //Total Comments
               $comments_count->total_comments;
               the_content(); 

          endwhile; 
          wp_reset_postdata();