How to hide objects that stands out of sight

Simondev on youtube literally just posted a video on this which is a great introduction. I said I was going to tackle this a while back but got distracted by other things. I’m really keen to support this, primarily for directional shadows as right now it need manually work to remove all the hidden stuff