I have been using the Twenty Twenty-Two theme in WordPress that is running on AWS lightsail multisite WP environment. I have found it easy enough to layout content using block editor.
Now I want to query data from the database (for now just want to use the WordPress database where I added a table) and display that information.
I see tutorials for older versions of WP but I can not find any resource that provide much guidance on this. What I know thus far is I can not simply add php code to a page or post.
The question of "[how to] simply add php code to a page or post [in WordPress]" is not easy to answer because there are multiple ways you might approach it.
I recommend you search for phrases like
Good luck!