The obligation to follow suit
Yes: if you hold the led suit, you are obliged to play it. It's the core rule of every trick-taking game.
The follow-suit rule
When a player leads a trick with a suit (spades, hearts, diamonds or clubs), every player after them must play a card of that same suit if they have one. This is called "following suit." You don't choose the rank, but you must follow the suit.
What if you're void in the suit
If, and only if, you have no card of the led suit, you may then ruff (play trump) or discard (play another suit), depending on the must-ruff rules. As long as you hold the suit, you must follow it, even when it hurts you.
Not following = a renonce
Playing another card when you could have followed is called a renonce: a penalised playing error. So check your hand carefully before playing. Trumps follow the same logic: if trump is led and you hold trump, you must play it.
See also
FAQ
Do you always have to follow the led suit?
Yes, if you hold at least one card of the led suit you must play it. You may only ruff or discard when you are void in that suit.
What's the risk of not following when you could?
It's a renonce, a playing error punished with a penalty, for example losing the deal for the offending team.