How I Met Your Mother ran on CBS for nine memorable seasons and was certainly legendary for many reasons, but one of the biggest was their use of running gags. Each character on the series had one — or several — jokes up their sleeves that were used at least once within each episode.

RELATED: Top Life Lessons from 'How I Met Your Mother'

From quotable catchphrases to recognizable items to notable fashion accessories, Ted, Robin, Lily, Marshall, and Barney let viewers in on their inside jokes during every episode.

"Eating A Sandwich"

Marshall, Lily And Ted Eating A Sandwich On How I Met Your Mother

Although HIMYM starred a 20-something-year-old friend group, it was narrated by an older version of Ted Mosby, voiced by Full House star Bob Saget, as he told his children the story of how he met their mother. And in doing this, sometimes he needed to sugarcoat some parts of his stories for his teenage kids.

When it came to mentioning times he and his friend ever smoked weed, Future Ted would always refer to it as "eating a sandwich." This joke appeared in the show several times and usually went hand-in-hand with the characters holding and biting literal sandwiches.

Barney's Catchphrases

Barney Stinson wearing his signature suit

Sitcom characters are typically known for their memorable catchphrases, and in Barney Stinson's case, he could have written a book full. From his, "Have you met Ted?" as Ted's wingman to his usually unnecessary, "Suit up!" to his determined, "Challenge accepted," Barney tended to use at least one of these in every episode.

And while Barney and his friends all had many catchphrases throughout the series, none are as remembered and still quoted to this day as Barney's signature, "Legen... wait for it... dary."

"Thank You, Linus"

Lily on How I Met Your Mother

Lily Aldrin was full of laugh-out-loud one-liners, but not many got the same amount of unexpected comedic relief as her famous three little words from the final season: "Thank you, Linus."

Due to all the stress and antics that came along with Barney and Robin's wedding, their maid of honor found herself needing drink after drink from the venue's bartender Linus. Any time something put the wedding in jeopardy, Linus would appear with a drink in hand ready to give to Lily, adding a hint of comedy to the unexpected wedding moments.

The Slap Bet

How I Met Your Mother Slap Bet

The Slap Bet was an agreed-upon rule between Marshall and Barney when the gang was trying to figure out Robin's secret (spoiler alert: she was a famous Canadian popstar named Robin Sparkles). The loser would be slapped by the winner, but when the wrong person got slapped, it ended in ongoing turmoil for the loser.

RELATED: Singers Who Guest-Starred On 'How I Met Your Mother'

Barney lived season after season with the fear of being slapped by Marshall after agreeing to be slapped five times at Marshall's desire, thus starting the running joke of The Slap Bet.

Barney's Suits

How I Met Your Mother Cast

Sure, Ted had his strange obsession with red cowboy boots and Robin once sparkled as a popstar, but no one's attire on HIMYM is as unforgettable — and snazzy — as Barney's suits.

Barney wore a suit in almost every episode of the show, verging on an obsession with the dresswear, and one episode even featured a musical number performed by the whole cast dressed in suits as they sang the original song "Nothing Suits Me Like A Suit."

The Doppelgangers

How I Met Your Mother

One of the most fun running gags on HIMYM was the unexpected appearance by one of the gang's doppelgangers. You never knew when or where someone would run into someone else's look-alike, and each one was unique in their own way, typically juxtaposing the main character.

The doppelgangers consisted of Lesbian Robin, Stripper Lily, Mustache Marshall, Mexican Wrestler Ted, and Fertility Doctor Barney, the latter of whom played a major role in Marshall and Lily's decision to try having children.

The Ducky Tie

Marshall and Barney Ducky Tie on How I Met Your Mother

Barney was typically known for being well-dressed until he loses a bet with Marshall and Lily and must don Marshall's ducky tie that Barney previously made fun of.

RELATED: Most Shocking Twists on 'How I Met Your Mother,' Ranked

Because Barney was instructed to wear the blue and yellow ducky tie for a year, the character is seen wearing it in almost every episode of Season 7, acting as a running joke on its own.

Mock Salutes

Ted and Robin on How I Met Your Mother

The mock salutes between Ted and Robin were a Major Running Joke. As an inside joke between just the two, their immature and unexpected interruptions to conversations made for hilarious moments for viewers.

Here's how the mock salute worked: any time a character would include the word 'major,' 'general,' 'corporal,' etc. in a sentence, Ted and Robin would interrupt as if they were saluting the Major, General, Corporal, etc. being mentioned.

The Bro Code

Barney on How I Met Your Mother

The Bro Code was one of Barney's many running gags that consisted of a set of rules that all "bros" should live by. Barney would often whack these out in regard to him and his male friends hooking up, dating, or even checking out girls.

The Bro Code later became a real-life book published by Simon and Schuster that is said to be written by Barney, with help from HIMYM writer Matt Kuhn.

The Pineapple

Ted Mosby And The Pineapple Incident On How I Met Your Mother
Image via CBS

When Season 1 of HIMYM aired an episode called "The Pineapple Incident," it sparked series-long discussions and theories on where exactly the mysterious fruit came from when it appeared on Ted's nightstand.

While the pineapple wasn't mentioned much during the series, the unsolved case came back up in Season 9 during a conversation with William Zabka, and later again in a deleted scene in which Ted finally remembers stealing the Pineapple from his rival The Captain.

NEXT: 'How I Met Your Mother': 10 Best Things Ted Mosby Taught Us