if I'm on a known legal trail, would I actually be lost? What am I trying to do? Get back to where I parked? Get to the nearest road? Find a particular turn to continue my planned route? Am I off of my planned route and need to return to it?
Second, the scenario is insufficiently laid out. My Garmin would have been started from the beginning of my ride, and will be showing where I've been. Easiest navigation scenario is to backtrack. You can even push a few buttons and have the Garmin do some of the work (show you the route) and beep at you if you make a wrong turn. If an unmarked, unsanctioned trail, I'm unlikely to know all details about it. The details of the scenario will determine if I follow it or not, given the uncertainty and what I DO know about it.
Also, before my ride, I will have topo maps and some trail database loaded onto my Garmin. The trails aren't routable, but I can see them and visually follow them. Also, with the topos, I can see the terrain so I can evaluate the feasibility of shortcuts if an emergency situation presents. I had to do this on a backpacking trip once to cut a trip short because I got sick.
On my cell phone, I can pull up mtbproject or trailforks. At least one of which will have that service's database for the state loaded into it (Trailforks apparently deletes your downloaded trails when it updates, so check on it occasionally). On the known, legal, mapped trails, that can help. On an unmarked, unsanctioned trail, it can at least show your position between any known/mapped ones.
I also almost always have a paper trail map for the place I'm riding that I can consult. Good maps with contours, roads, streams, etc can be great.
Lay out a more detailed scenario, though.