How to make the camera render only the mesh in the front of it without rendering other objects

I put a static mesh before the camera, and then want the camera to shoot only the object without displaying the background.

As shown below, how can we only see the cube without displaying the background behind and the sky. Similar to the layers in Photoshop, place the cube on that layer, rendering only that layer. How to set up in unreal?
213837-
][1]