When you find yourself trying to remember a show (or any works) that's on the tip of your tongue but just out of reach, come here - the collective brain of the TVTropes community can probably help. Post all the details you can remember (examples help). If you're looking for a trope, head over to Trope Finder. Have general questions about tropes? Visit Ask The Tropers!
Possibly a 1983 comedy called The Survivors, in which Robin Williams costarred with Walter Mattheau. No page on TV Tropes, but a plot summary indicates Robin's character gets scared by a bad guy and joins an "extreme survialist school" to learn self-protection in the wilderness.
Another possibilty could be a 2006 comedy called "RV". Williams plays a family man named Bob who gets a big recreation vehicle and takes everyone camping. Many misadventures occur.
Edited by PCD
I'm pretty sure it was Robin Williams. I only remember one scene. Williams character was in a forest, I think he was lost. And he was said that he needed to walk, making sure to keep the sun on his back. And he was also traveling with a woman.