I often wonder about this, too... assuming no navaids and sketchy or nonexistent visual waypoints, the best any pilot could do would be to be very sure of his position just prior to a dogfight, and either fly a reverse course to the takeoff point, or to the nearest friendly base (if low fuel, weather, or combat damage/wounds were factors). They were well-schooled on compass, clock and chart, and I'd imagine a whiz wheel was available to most of them. But woe betide them if they were already lost when the fighting began... getting home then would require some extra luck.
Yes, even bomber formations got lost, sometimes on the way
to the target. A friend's father was a B-24 navigator based in Italy at that time... told me a story about the lead navigator (who'd been celebrating his birthday the night before) almost leading them straight into Swiss airspace on a mission into Germany, in pretty good weather. Nobody wanted to get the guy in trouble (or break radio silence), but when it was clear they'd have to turn or bust the very well-defended neutral airspace, somebody finally spoke up.
Most of these airmen were youths, and pretty wet behind the ears as pilots... but as someone stated earlier, if they didn't show that they'd made the most of the hurried training (which emphasized the basics), they wouldn't be PICs or navigators on combat missions. And yes, the attrition in training was very real... ex-NAS Wildwood, for example, is surrounded by many, many sunken wrecks of Helldivers that crashed during training flights.
Green as they were, these guys who made it to combat posts were the best available.That's why most of the time, they made it to a suitable destination after missions, even if they were separated from their group, with a damaged aircraft, wounded... or all of the above (imagine that! Not my idea of a good time, even with a radio beacon leading the way). As for the times they didn't- well, no method or system is perfect. Even today, people still fly into mountains with a perfectly good GPS aboard.