How to set a boundary around an object?

I want to set a boundary around a sphere so it doesn’t go through two walls?
Any ideas?
Thanks !

Try to add a rigidbody or a sphere collider on the sphere , so it collides with any other object.