How to query wp_site_posts?

Hi!

Just wondering how to go about querying a particular table for displaying custom post types on a page? I assume I put query code (which I've googled and found some examples of) in a custom template file within the theme. But how do I narrow it down to query just the Post Indexer table/s?

BIG thanks!