Pinky the Elephant is a pink elephant who Barney imagines.
When Barney drinks Seth and Munchie's soda, he imagines a monster in his house, so he drinks beer to appear Pinky, which saves him, and Barney thanks him, also claiming that he was "always there for [Barney]".
Behind the Laughter
Pinky greatly resembles, and is most likely based and named after, the Pink Elephants from the Disney film Dumbo. Coincidentally, both characters also appeared during a segment of implied drunkenness of the characters (as the infamous Pink Elephants on Parade segment occurred after Dumbo and Timothy Mouse accidentally drank water laced with whiskey).