Deleting Unseen Meshes Like Minecraft

So, I created a minecraft like terrarin generation but optimisation is very bad. In Minecraft, only the visible faces of the blocks are rendered. So I need to delete unseen meshes (or something like mesh). How can I do this?

If you use the console command

freezerendering

you can then move the camera around and see what is being drawn, and what is not.

The engine only draws what it needs.

Probably the main question is, did you write this in CPP? If not, then that would be the first place to go.