theme development – How do I open a post in a coustum page in wordpress?

I’m new to coding wordpresst themes. I made a whale loop on the index.php page, by clicking on the link I want the post to open on another page.php. Do I need to change anything to Permalink or?

The example below is index.php, and the page.php (page.php example does not have an excerpt).

index.php

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
    <head>
        <meta charset="<?php bloginfo("charset"); ?>">
        <meta name="viewport" content="width=device-width">
        <title><?php bloginfo("name"); ?></title>
        <?php wp_head(); ?>
        <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(). "/style.css" ?>">
    </head>
    
<body <?php body_class(); ?>>
<div id="loop" class="loop" >
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
     <div id="loop-con" class="loop-con">
         <div id="thm" >
         <?php if ( has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail('medium'); ?> </a> <?php endif; ?>
         </div>
         <div id="ex" >
             <div id="ext" ><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
             <div id="exe" class="child7947810000"><?php the_excerpt(); ?></div>
         </div>
    </div>
<?php endwhile; else : echo '<p>No content found</p>'; endif; ?>
</div>
<?php wp_footer(); ?>
</body>
</html>

page.php

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
    <head>
        <meta charset="<?php bloginfo("charset"); ?>">
        <meta name="viewport" content="width=device-width">
        <title><?php bloginfo("name"); ?></title>
        <?php wp_head(); ?>
        <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(). "/style.css" ?>">
    </head>
    
<body <?php body_class(); ?>>
<div id="loop" class="loop" >
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
     <div id="loop-con" class="loop-con">
         <div id="thm" >
         <?php if ( has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail('medium'); ?> </a> <?php endif; ?>
         </div>
         <div id="ex" >
             <div id="ext" ><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
         </div>
    </div>
<?php endwhile; else : echo '<p>No content found</p>'; endif; ?>
</div>
<?php wp_footer(); ?>
</body>
</html>