I imagine you would do it in just the same way you give characters any other personality trait. What is it exactly that you want to know?
Quirks more or less equal any other personality trait... Just some of them are odder than others. If you mean, like, tiny mannerisms, it's just a matter of picking one and remembering to mention it from time to time, with increasing frequency as they get stressed or something. Can even be added in after the rest is written if they're insignificant. If you're going for quirks in the sense of odd humour/taste in things, then it's really just how you'd do any other personality thing like someone who's always madly happy. One of my characters is the "zany" one, you know? Except I didn't want her to be like all the other motor mouthed crazy ones who's always coming out with nonsense, so I've made a massive effort to make her only speak once or twice a scene no matter how much conversation goes on around her, so when she does speak the odd things she says has more meaning. Because the weird quirky character hogs the attention a lot of the time. By doing that it means I'm a lot more aware of her presence in a scene, and so I know it's time to show her quirks off the rare times she surfaces.
I think showing is the best way here, and to do that on several occasions without putting much emphasis on it, the reader will accept it as a part of the character.
I think that while quirks are supposed to be sort of out-of-the-blue kind of things, the sort of details that don't seem to really have much connection to anything at first, I think they still should make sense in the context of the personality and/or background of the character and/or other quirks. For instance, a character who has been shown to be extremely stoic, and who has been revealed to always keep a poker face no matter what, probably will not have eyes that dart around nervously when he's lying, since that conflicts with the idea that he knows how to keep a poker face - however, maybe he taps his foot in a certain rhythm, or keeps scratching his elbow or something, since these don't conflict with his poker face. As another example, let's say a character always keeps avoiding eye contact around certain people or in certain situations even though he's capable of keeping eye contact at other times. It seems to be pretty simple, indicating that the guy is shy or nervous or something of the like. Not exactly. Let's say he's Japanese, or Apache, or from some other culture where one is not supposed to make eye contact towards certain people or in certain situations - then his eye contact means something else entirely, that maybe he is extremely respectful, or maybe he is unaware of cultural differences if he's dealing with Westerners, etc. Same little quirk - but entirely different meaning, depending on the context. Ultimately, point is, make sure the quirks make sense for the character. Usually I don't think you really have to put much thought into this, to be honest, as it probably won't matter, but sometimes you do have to be a bit careful.
I think I work the other way around match the character to the quirk when I want them to have one. But very good rant nonetheless.
I know this may not even apply to you, but I'd like to warn you against using quirks as the backbone of character development. Don't get me wrong, quirks are great and lots of my characters have them (I love making them exaggerated in my political satire stories) - however, if a character is bland and inconsistent, throwing in a fun random quirk will not make up for it. As for quirks, I agree with Mel and Cybrxkhn - they give very good advice.
No, quirks are like odd food combinations. Sometines they work out great, but most of the time they are just weird. A little chocolate is great in chili, but anchovies on vanilla ice cream are not going to win any prizes.
I don't think picking a quirk to match a character is the right way to go about it. I've found that if I consciously try to give a quirk to the character then it will come across as feeling forced/appear too obvious in the writing too - it's like when people try to force a flaw upon a character. If a character has any quirks then they will come out naturally in either the outlining or the writing process as they begin to feel more "alive".