How do the feelings Olivia, Viola and Orsino have for each other bring out comedy, heartbreak and triumph of true love in Twelfth Night?
Let's look a these terms: Comedy, Triumph of True Love, and Heartbreak, as they describe the love relationships in Twelfth Night.
First, Comedy. Structurally, a play that is termed a Comedy is meant to end in at least one marriage. So, to technically fulfill the requirements of your first term, Comedy, Shakespeare has all three couples (including Toby and Maria) end the play preparing for marriage.
Triumph of True Love really suits Viola's feelings for Orsino and how his feelings change at the end of the play. She loves the Duke quite against the odds from the outset, and even goes to great lengths to woo his lady love for him. It seems that her case is hopeless vis a vis becoming his wife, since he only knows her in her disguise as the boy Cesario. Once she is revealed at the end of the play, and Orsino is able, in an instant, to realize that he has loved her all along....Well. That is the triumph that any unrequited lover is looking for.
As for Heartbreak, it seems to involve all three of the characters you mention to some degree. Both Orsino and Olivia begin the play in deep heartbreak -- Orsino over Olivia and Olivia over her brother. Even the plucky Viola is overcome with this sense upon meeting and falling in love with Orsino. She even describes herself (as a woman that she knows) as:
A blank, my lord: she never told her love,
But let concealment like a worm i' th' bud
Feed on her damask cheek: she pin'd in thought,
And with a green and yellow melancholy
She sat like Patience on a monument,
Smiling at grief.
When it comes to Heartbreak, I can't think of a better way to phrase it.