Gary Blauman was at the center of many lessons on How I Met Your Mother. The character, played by Taran Killam, appeared in five of the sitcom's nine seasons. Killam is notably married to Cobie Smulders, who played Robin Scherbatsky throughout How I Met Your Mother's entire run.
When Gary was introduced, he worked in the legal department at AltruCell Corporation before it merged with Goliath National Bank. Barney worked at AltruCell when Marshall got an internship with the company in How I Met Your Mother's first season. Marshall wasn't a fan of his co-workers in the legal department, including Gary. Over the course of the series, each member of the gang encountered Gary and gathered varying opinions about him.
Gary's first appearance on How I Met Your Mother came during the seventeenth episode of season one in the episode, "Life Among the Gorillas." Marshall wasn't fitting in with his co-workers, Gary and Bilson, so Barney suggested changing his personality to be more like them. Lily wasn't too pleased with Marshall's change in personality since it spilled out into his personal life. Gary returned in the season 3 episode "The Chain of Screaming", when Barney tried to teach Marshall a lesson about not yelling at a boss. Barney claimed that he once saw Gary getting yelled at and he answered back by yelling back while trying to pee on the conference table. Gary then quit and stated that he would become rich from his cousin's website. Barney shared that the website tanked and Gary became a janitor at an old folks' home and lived above a bowling alley before he died.
The tale about Gary's death was revealed to be false during How I Met Your Mother season 4. Gary appeared in the episode, "Sorry, Bro," and was still working for GNB, so it was clear that Barney exaggerated his prior story. Gary was present when Marshall played basketball with some of his co-workers, and notably forgot to bring his work pants. The character was seen again in the season 5 episode, "Jenkins," and introduced a new employee to Marshall. Gary teased Marshall by telling Jenkins that Marshall's nickname was "four-eyes" and claimed that Marshall liked to steal things.
Gary's most memorable storyline came in How I Met Your Mother season 9. In the self-titled episode, "Gary Blauman," Ted and Tracy (aka the Mother) went on their first date and contemplated going to a restaurant without a reservation. Ted thought back to Gary and how he didn't reserve a seat at Barney and Robin's wedding. While trying to fit Gary into a seat, the group looked back at their encounters with Gary. Ted remembered that he and Gary once fought for a girl's affection during a party. The group then learned that Barney's brother, James, once had an affair with Gary so they realized Gary could have had a crush on Ted. Barney also wasn't a fan of Gary since he once stole some of his fries at McLaren's Pub. Lily, on the other hand, liked Gary since he once stopped her from getting a tattoo.
In the end, Gary attended the wedding since he didn't want to miss the event. This taught Ted that it was so easy to lose track of acquaintances in life and he should hold on to the ones who were most important to him. Killam made one last appearance on How I Met Your Mother during the episode, "The End of the Aisle," which featured Barney and Robin's wedding ceremony.