I heard from an old German sailor that the primary means to find your location in the ocean (without GPS of course) would be the stars, the maps of the general flow of the tides and maps of the ocean depths. I recall reading a story of a U-Boat Ace sailing up to Scotland and attacking a RN convoy there. A feat his peers thought impossible because of all the sand banks en-route. Was there any other means for them to navigate?
WWII submarines navigated in the same way that surface ships navigated, which is to say via celestial navigation (taking bearings on the stars at night or sun during the day); using chronometers to determine longitude; by using longstanding tools (compasses, peloruses) to determine bearing; by using tools to establish the depth of water under the submarine (Fathometers and the like) and by basic piloting skills (taking the sub's bearing relative to land or landmarks).
Your question may stem from a misapprehension -- World War II submarines can be better thought of as "submersibles" than "submarines" -- they did not travel underwater for long distances, and only traveled very slowly underwater. Most of the time they were surfaced.
I recall reading a story of a U-Boat Ace sailing up to Scotland and attacking a RN convoy there. A feat his peers thought impossible because of all the sand banks en-route.
This sounds like a bit of a garbled version of Gunther Prien's raid on Scapa Flow in 1939, when he conned U-47 into the harbor and sank the British battleship HMS Royal Oak. Prien had to navigate a tricky course into and out of the harbor, but he did so on the surface.