Are you getting the cold shoulder, but you don't know why? Is someone who's normally eager to speak to you now keeping your conversations to the bare minimum? This can be hurtful, frustrating, and confusing. Here's how to confront the person who's ignoring you without making things worse.
Make sure you're not just being paranoid. Perhaps he or she is being quiet because someone in his or her family is ill, or is having personal problems. In this case, you shouldn't take it personally - give him or her some space. But, if you notice that this person is only acting quietly towards you and not towards others for an extended period of time then you may have reason to be concerned.
Test the waters with a sense of humor. If the person is just in a bad mood (maybe because of something you did, maybe not) you might be able to lighten the mood with a little bit of playfulness.
Question your own behavior. When did the silent treatment start? What happened that day, or in the days just before the behavior changed? Could you have done or said something insensitive? Did something change? Try to understand what could set off the silence. Narrow it down to a few possibilities and try to think of how you can fix the situation.
Rehearse what you're going to say. You want to have one conversation and then feel like you said what you needed to say, so plan it ahead of time. It's easy to get nervous and/or defensive, or to come off the wrong way, if you aren't prepared. Close your eyes and imagine you're alone with this person and say out loud what you want to say. Listen to the way you make your statement, and adjust your tone if need be.
Speak in private. Speak to the person when you're alone and are unlikely to be interrupted.
Begin by apologizing if you did something to offend or hurt the person, even if you're not sure what it is. Say something like "Look, I'm sorry if I've done or said something stupid to you."
Say that you value his or her company or friendship. E.g. "I've really enjoyed spending time/working with you." or "Please help me out here, because I appreciate your friendship so much."
Honestly express how this makes you feel. Let them know that you need to take care of yourself, too. Example: "It really hurts that you are shutting me out, and I wish you would talk to me. But I think about this so much that I can't study or even sleep, so if this continues much longer, I'm going to need to stop waiting and just assume that you do not want to be friends anymore. I don't want to do that, which is why I'm telling you now."
Be open to whatever s/he has to say. Let him or her know that if there's a problem, you're all ears. People want to know you understand what you are apologizing for. Paraphrase, make educated guesses: "and that made you feel sad?", and use stories to reach mutual understanding.
Offer to walk away. After all, a silent treatment indicates that he or she no longer wants to speak with you for whatever reason. If you have tried to discover the problem, but s/he won't share or discuss the reason, there's not much else you can do. See if the person can confirm that s/he wants you to stop talking to them. If the answer is yes, s/he want you to leave him or her alone, then do so. If s/he says no, or not really, or I'm not sure, then say something like "Okay, well, I'm here whenever you feel ready to talk again. I really like being friends and hope we can work this out." Leave the burden of calling or initiating contact to them, so that they can have the space and time that they need.
Only try once. After you have apologized and attempted to understand what is going on, you have done your part. Now, it is up to the other person to step up and begin communicating with you. If they do not, that is their choice. You cannot single handedly fix this.
Pat yourself on the back. Confronting someone takes courage, and you've handled it as best and as maturely as you could! No matter what the final outcome is, you faced up to a problem squarely, made your best effort to resolve it, and accepted the result.
Your objective should be to let the person know that (1) you didn't mean to offend or insult, (2) you've tried to understand his or her point of view, (3) if there is a need to address something with you, you agree to hear him or her out fully, and (4) if s/he wants to keep the reasons to him or herself, and stop talking with you, you'll respect his or her wishes.
If you make the person feel pressured to tell you what's on his or her mind, or if you offer guilt or more coldness in return, you might reinforce the behavior and miss a chance to save the relationship.
Keep in mind that no one can be obligated to speak to you. Everyone has the right not to speak to anyone they like. If someone else has made that choice and chooses not to reconsider, your role becomes finding a way to accept that. At some point, it's no longer about the other person. It's now about you finding the maturity to let it be.
If you're not sure whether it's the silent treatment, try asking more generically, "You've been awfully quiet lately. Is anything wrong?"
Don't feel guilty for failing as a mind reader. You can do your best to understand why this person no longer wants to associate with you, but for him or her to clam up and expect you to figure things out on your own is unrealistic, and exhibits poor communication skills. If s/he keeps giving you the silent treatment every time your relationship hits a bump in the road, and you've made it clear that you're receptive to hearing the other person's perspective, then maybe the relationship is better off silent. One who seems to relish nursing a grudge makes for a difficult friend; in the end, friendships are supposed to be a refuge from the storms of life. If this friend is causing storms in your life on a fairly regular basis, it's not something you should "get used to" or put up with. It's something you should nip in the bud early, or accept the fact that you may just need to find friends who are supportive, kind, and communicative instead.
The silent treatment is a form of control.
If this is happening on a regular basis, it can be a form of emotional abuse. In an abusive relationship, even if you do everything "right," you will never be able to stop the abuse completely.
If you are just being paranoid, they can become angry with you. Think step one over well before proceeding. Consult with friends to confirm your perceptions.