Must You Follow Suit in Hearts?

Short Answer
Yes. If a player leads a suit (clubs, diamonds, spades, or hearts), you must play a card of that suit if you have one. If you're out of that suit, you can play any card (often called "shedding" or "sloughing").

What Does "Follow Suit" Mean?

Hearts is a trick-taking game. Each trick starts with a lead card. Following suit means matching the suit that was led.

Example

Someone leads a "10" of Diamonds. If you have any diamonds, you must play a diamond. If you have no diamonds, you can play any card in your hand.

If You Can't Follow Suit, What Can You Play?

If you are void in the led suit (you have zero cards of that suit), you can discard any card. This is a big part of Hearts strategy because it lets you:

First Trick Exception (Common Rule)

Many Hearts rulesets add a restriction on the first trick: hearts and the Queen of Spades cannot be played, even if you can't follow suit, unless you have no other legal card.

If you're unsure which version you're playing, this page covers the typical standard rule:

Does Following Suit Affect "Breaking Hearts"?

Following suit is always required, but leading hearts is often restricted until hearts have been "broken" (meaning a heart has been played on a non-heart lead).