You’ll have to set up trigger volumes that change the properties of the skylight/directional light/fog/etc when the player walks in/out of them.
You can see this trigger happen really easily in Elden Ring when you enter a catacomb/cave style dungeon.
Generally developers try to hide the transition by building an S-shaped bend in a hallway before you enter the area so that you can’t see the entire lighting/atmosphere change suddenly, this only really works well in games like Elden Ring or Dark Souls where the entrances/exits to areas are limited and tightly controlled.