The player will collide naturally with any other collider in the scene set to the Default layer.
Alternatively, you can use the prefabs InvisibleCollision (which is just a single plane hidden at runtime) or InvisibleCollisionShape which allows you to define a confined space for your player to move within.
Both of these are set using the layer OnlyCollidersWithPlayer.

Use the shape component to add and remove points that can be moved in the scene to define a shape. Select “Close Shape” to connect the first to the last point of the shape.

When finished, click “Update” on the ShapeCollider component to update the collider to the new shape.