Templates and meta

get_post_meta is your friend.

get_post_meta( int $post_id, string $key = '', bool $single = false )

Retrieve post meta field for a post.

Note that custom fields are named post meta internally.

e.g.

$key_1_value = get_post_meta( get_the_ID(), 'key_1', true );
// Check if the custom field has a value.
if ( ! empty( $key_1_value ) ) {
    echo esc_html( $key_1_value );
}

Be warned though, it’s tempting to store everything as a post meta, until you have to search for all posts with X meta with Y value. At this point X should have been a custom taxonomy, and your sites speed will tank massively.