In How I Met Your Mother, as in any sitcom, sex is a significant plot device used to enhance stories and characterization. Ted Mosby craves love from the beginning, and physical intimacy is a part of his emotional journey. With Robin Scherbatsky's character, viewers notice the sexual liberation of women and sometimes, the repression of sexual expression. The shameless womanizer Barney Stinson, on the other hand, contributes towards solidifying women's objectification.

RELATED: How I Met Your Mother: 10 Times Robin Said Everything Fans Were Thinking

HIMYM's wonderful couple, Lily Aldrin and Marshall Eriksen are anything but discreet about their love life. She often asserts her sexual agency, and he values her consent. How I Met Your Mother scores brownie points for the healthy portrayal of sex on TV. Nonetheless, there are numerous pitfalls to watch out for.

How I Met Your Mother Marshall Lily and cab driver

In the show's pilot, an interesting piece of conversation unfolds between Marshall, Lily, and a cab driver. As it's seen, Marshall accidentally pops a rogue champagne cork into Lily's eye. While getting on their ride to the hospital, their taxi driver is obligated to inquire about domestic abuse.

Lily assures the driver his partner is neither violent nor abusive towards her. She also adds an extra bit about her and Marshall's relationship dynamics. Lily proudly tells him that Marshall asks for her consent before intimacy and she is able to openly express what she wants from him.

Not: Ted Forgives Robin But Outgrows Barney

How I Met Your Mother Ted Barney Robin

Ted Mosby reacted pretty awfully when he found out his former ex-girlfriend, Robin, and close friend, Barney had spent the night together. The incident is an obvious example of male sexual entitlement, with Ted believing Robin was out of bounds for people related to him.

Ted lashed out at Barney saying, "Three billion women on the planet! Three billion! And you have to sleep with the one that I dated for a year! Are you kidding me?" There are rules about fooling around with a friend's ex, however, Ted should have been equally mad at both his friends. He forgave Robin in a heartbeat but stopped being friends with Barney altogether.

Sex Positive: Robin & Lily Questioned Ted's Behavior

How I Met Your Mother MacLaren's pub

How I Met Your Mother deserves praise for questioning Ted's behavior in the subsequent episode, "Rebound Bro." It's been a while since Ted found out about the whole Robin and Barney incident and the gang is seated at MacLaren's Pub minus Barney.

RELATED: How I Met Your Mother: Robin's 5 Best & 5 Worst Traits

Ted picks up the phone when Barney calls and tells him to stop calling, prompting Robin to ask, "Let me ask you something, Ted. Why are you so much madder at Barney than me?" Lily immediately jumps in to remind Ted that Robin and Barney were equally involved in a consensual act. The two women refused to watch Ted forgive Robin but not Barney.

Not: Victim Blaming Attitude

HIMYM Robin Sitting At The Pub Next To Another Woman

Season 5's "The Playbook" showed Robin and Barney coping with the end of their relationship. She threw herself into her work and he rushed back into luring women using his Playbook. Barney's book was a collection of outrightly disgusting tricks he'd used or hoped to use in the future to manipulate women into sex.

When Robin was asked how she felt about Barney's behavior, she vocally suggested his victims were to be blamed. "If these girls are dumb enough to fall for this crap, they have it coming," Robin remarked. The worst part however was watching the most well-read member of the gang, Marshall, back Robin's victim-blaming attitude.

Sex Positive: Sexually Empowered Professor Lewis

How I Met Your Mother Professor Lewis Barney

How I Met Your Mother explored the sexuality of a middle-aged woman in the episode, "Aldrin Justice."  The character in question, Professor Lewis was Marshall's constitutional law professor at Columbia. She was a charming, intelligent woman with a no-nonsense attitude.

Professor Lewis had recently gone through a bad divorce and Marshall assumed she was taking it out on her students by being a tough grader. Barney slept with her to help his friend out, but she was less than pleased with his prowess. Comdy chops aside, it was a great move on the show's part to showcase an older woman enjoying her sexuality.

Not: The Naked Man Move

Robin arrives at her and Ted's apartment to see the naked man theory at play, agreeing to sleep with him and getting slut-shamed for it in How I MEt Your Mother

In the episode, "The Naked Man," Ted finds a naked stranger sitting on his couch who introduces himself as Robin's date, Mitch. He explains he's making his 'naked man' move which is essentially about charming a woman by stripping down in her apartment while she leaves the room. Mitch proudly claims the theory works two out of three times and ends in sex. As inappropriate as it sounds, the naked man works on Robin.

RELATED: How I Met Your Mother: The Characters' 10 Most Impractical Outfit Choices, Ranked

There's nothing charming about finding an undressed stranger in one's apartment. It's offensive, insulting to a woman's intelligence, and more importantly, borders on sexual assault.

Sex Positive: The Beginning Of Ted & Robin's Relationship

How I Met Your Mother: Robin kisses Ted

The beginning phase of Ted and Robin's relationship was a lot of fun. The two seemed happy, carefree, and cherished each other's company. Ted had finally gotten together with the girl of his dreams and she reciprocated his love.

Physical intimacy was an important aspect of Ted and Robin's relationship. Its on-screen depiction ultimately meant they shared a deeper connection with each other. Ted had no reservations in admitting he'd been off having the best nights of his life with Robin and that the couple spent most of the time in bed.

Not: Barney's Story Arc

HIMYM Barney Stinson

HIMYM overdid the womanizing trope with Barney Stinson's character. He was deeply problematic from the beginning to the end. It took him nine seasons to break his bad behavior.

Barney was a belligerently sex-crazed, and misogynistic man who once said the rules for girls were the same as the rules for gremlins. He saw women as sexual objects and went to great lengths to get them into bed. Barney was dismissive of the fact that women too could handle casual flings and needn't necessarily be manipulated into sleeping with him.

Sex Positive: Lily Asserts Her Sexual Agency

How I Met Your Mother Lily Marshall

Lily and Marshall were inseparable since the first day of college at Wesleyan University in Connecticut. After they got engaged in HIMYM's pilot, Lily showed more physical affection and love towards Marshall. She could barely keep her hands off him during this period. The two spent quality time being intimate with each other.

It's noteworthy that Lily was able to recognize her sexual desire, and freely express it in front of Marshall. All of these were signs of a healthy and mature relationship.

HIMYM Barney Marshall amd Robin

Barney was a sex-offender and should have gone to jail for violating consent on more than one occasion. Among his countless wild antics was taping women without their knowledge and will. In the episode, "Game Night," Barney secretively filmed his former girlfriend, Shannon, during their intimate moments.

He proudly showed the phone clip to his disgusted group of friends. Sex tapes are only legal if made consensually. Taping someone without their permission, and actively lying about the same, is a betrayal of trust and a sexual offense.

Next: How I Met Your Mother: 10 Things About Barney That Would Never Fly Today