In order to check a habitat you will have to see the pokédex of the pokémon. To do this you will have to press the flat line button (–).
Alternatively, you can access the Pokédex through the map with the Y button and then press the X button and select the Pokédex. This will allow you to check any Pokemon they have recently caught or battled. You can also get a full view of everything by simply selecting the main Pokédex book at the top.
Then you will have to press the button in or entrance to see its different habitats. This will work even if a player hasn't seen the Pokemon yet, as long as the entrance is there, the habitat can be accessed.
In the event that a Pokémon's habitat is unknown, you will be able to obtain it from events.
This is all you need to know about how to check the Pokémon habitat in Pokémon Scarlet Violet, so we hope we have been as helpful as possible to you.