Barney Stinson (Neil Patrick Harris) is Ted's wingman and good friend (though Barney considers Ted his best friend). 

Barney is a womanizer and it's revealed it's the way he is because he was once a hippie who wanted to join the peace corps but lost his one serious girlfriend, Shannon, to a suit wearing rich womainizer. 

Barney then became that man and ever since is always seen out in a suit (except to funerals) and utters some of the best catch phrases and pickup lines in television history.

Barney once violated the bro code and slept with Ted's ex-girlfriend, Robin.  Barney has true feelings for Robin, as revealed to Lily, but does his best to hide them.  They ended up dating briefly but broke up after half a season.

Barney Stinson Quotes

Jerry: A magician never reveals his greatest trick, but I'll give you a hint. You've gotta meet the right girl. Who knows, maybe you'll meet her tomorrow?
Barney: Maybe I've met her already.

Whatever you do in this life, it's not legendary, unless your friends are there to see it.


HIMYM Quotes

Ted [to Stella in his dream encounter]: You picked the wrong guy.
Stella: Ted?
Ted: You picked the wrong guy. You made a really, really, really bad choice. What were you thinking? That guy? Are you kidding me? Have you learned nothing in the last eight years? You're just gonna regret this. You know that, right? You are going to regret this, and now there is nothing you can do about it because it's too late. All you can do now is go up there and start your crappy, disappointing life that will never be nearly as happy as the one you could have had with me. Good-bye.
Stella: Ted, wait.
Ted: Look, Stella, I am not here to win you back. I am here because I need to know that you know you made the biggest mistake of your life.
Stella: I know

You are the love of my life. Everything I have and everything I am is yours. Forever.