The inputs they'd be able to use would include:
1. GNSS location (only if surfaced)
2. Passive sonar data (detecting location of electromagnetic signals through water e.g. acoustic noise of another ships propeller)
3. Active sonar data (only if stealth is unnecessary)
4. Radar data (only if surfaced)
5. Bathymetry models/charts[2] (accuracy depends on location in the world)
6. Tide prediction models[3] (availability is location dependent)
7. Inertial navigation sensors (dead reckoning so accuracy drifts over time)
8. Surface Electronic Support Measures sensors (allows geolocation of signals from other ships, aircraft and ground transmitters)
[1] https://osimaritime.com/solutions/software/ecpins-submarine/
[2] https://www.admiralty.co.uk/digital-services/digital-charts/...
[3] https://www.admiralty.co.uk/publications/admiralty-digital-p...
https://youtube.com/playlist?list=PLjHf9jaFs8XWoGULb2HQRvhzB...
- how submarine systems work: https://www.youtube.com/playlist?list=PLF9K78gj2FP2fDVRu_Bkc...
- sonar acoustic signal analyses: https://www.youtube.com/playlist?list=PLF9K78gj2FP2D-EIZkYN1...
- overview of sub classes: https://www.youtube.com/playlist?list=PLF9K78gj2FP0hID8jeOp_...
If you're up at periscope depth you can stick a periscope up to see and other antennas. If you're on the surface you typically send people up into the sail and the boat is commanded from there. (Only a couple people fit up there, so the people actually operating the rudder and navigating are belowdecks).
Overall you generally get a good indication of what's happening, but... it's definitely possible to be surprised.