Sanity can be restored in several different ways, depending on your playstyle.
Eating certain foods is one of the easiest methods. For example, Ice Cream, Cooked Green Caps, Cactus Flesh (after cooking), Taffy, and Jerky restore Sanity.
You can also wear clothing and accessories that provide a passive Sanity bonus, such as the Top Hat, Tam o' Shanter, or Garland during the early game.
Finally, staying near positive Sanity sources like a Tent or Siesta Lean-to or getting a good night's sleep can also help recover Sanity. Avoid spending too much time in darkness or near disturbing creatures, as these will quickly reduce it.