Apple Watch Ultra, Apple Watch SE, and Apple Watch Series 6 and later models running watchOS 9 and newer have a Backtrack feature in the Compass app to help retrace steps if you get lost.
Backtrack uses GPS to create a breadcrumb trail of your route, suitable for remote settings, and densely populated areas without Wi-Fi.
To use Backtrack, open the Compass app, tap Backtrack, and Record Path to start tracking your route. Tap Retrace Steps to find your way back.
When you arrive at the starting location, tap Backtrack and Delete Path to finish. Apple Watch Ultra users can start Backtrack using the Action button in Settings.