Do not apply physic if it is colliding with the floor

Good Night

I used rigdbody 2D and BoxCollider 2D,
But I didn’t want it the object fall in edge
Ex:

I wanted it to stay that way.

EX:

How do it?