Simply replace the post i.d’s in the code above with your own.
add_action( 'pre_get_posts', 'wpsites_remove_posts_from_home_page' );
function wpsites_remove_posts_from_home_page( $query ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'post__not_in', array( 37401, 37403 ) );
}
}