The vast majority of the time, boats don’t use active sonar. Whilst giving a high resolution view of what’s around them, it also allows any other signals collector (often defined as an enemy aggressor) to accurately pinpoint the location and deploy countermeasures, even if only updating threat assessments.
Ultra detailed charts are used that have the terrain mapped. Occasional positional fixes when a boat surfaces can be used to ‘reset’ where they thought they were whilst running silent.