UI element behind terrain

I have a task to make it so that when the player exits the collider, the UI image appears, but when the UI appears, it is behind the terrain

Show us some screenshots, it’s hard to debug without seeing anything.

You can use camera stacking to ensure UI is always renderer in front of everything else.

If you use URP : Camera Stacking | Universal RP | 7.2.1