As Title implies, Search the value inside the variable of $word inside the tag of column post_title content.
$word = test;
$pQuery = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->posts
WHERE post_content LIKE %s",'<h1>%'.$word.'%</h1>'), ARRAY_A)
ID post_title post_content
1 Hello <h1>This is a post</h1> <p>This is a description of a post to test if the query is working</p> <h1>Found me test</h1>
2 World <p>This is a description of a post to test if the query is working</p>
The query should view the data of of this ID
1 - Hello - <h1>This is a post</h1> <p>This is a description of a post to test if the query is working</p> <h1>Found me test</h1>