WordPress finds the correct PHP file based on what is being displayed — first match wins.
# Single post (most to least specific)
single-{post-type}-{slug}.php
single-{post-type}.php
single.php
singular.php
index.php
# Pages
page-{slug}.php
page-{id}.php
page.php
# Category archive
category-{slug}.php
category-{id}.php
category.php
archive.php
# Reusable parts
get_template_part('template-parts/content', 'post');
# Loads: template-parts/content-post.php