You need to do camera work. I don’t know if there is a tutorial on it or a ready solution. Have you searched?
Basically, put a collision sphere around the camera that blocks and don’t move the camera if it’s trying to overlap the sphere. How you do that is up to you.