To simplify the index.php file, open the file in the editor and get rid of all the code present in it except the <?php get_header(); ?> and <?php get_footer(); ?> lines. This is how our index.php will look like:
<?php get_header(); ?>
<?php get_footer(); ?>
We will then check for posts and if there are posts, loop through them and spit out the correct content file. Now, we will add <?php if(have_posts()) : ?> and then we'll use the shorthand syntax as shown here:
<?php get_header(); ?>
<?php if(have_posts()) : ?>
<?php endif; ?>