How can I hide parts of mesh?

The screenshot door beyond the wall:

This is an expected result:

Below is presented a my solution: