Wet your hair and apply some conditioner throughout. You can also use a bit of leave-in conditioner. The conditioner dampens and lubricates your hair, making it easier to get through those tangles.
Get yourself relaxed. No, this isn't rocket science, but that doesn't mean it's not going to make you incredibly frustrated. If you have more than one matted bit of hair to deal with, it's going to be a bit taxing on your wrist ... and your patience. Put some music on, light a couple of candles -- whatever it takes to get yourself a bit mellower. This also gives your conditioner time to soak into your strands.
Use wide-toothed comb or a detangling comb, starting at the bottom of the first mat and doing your best to comb it out. This is the part where remembering to have patience really comes in handy. As the mat starts to come out, continue working up until you get it all out.
For any mats that are being really stubborn, add a dab of mineral, olive or jojoba oil directly onto the hair and try combing it through again. The oil is lubricating like the conditioner, only a bit more slippery, so it may add just enough for you to get those frustrating tangles out once and for all.
Condition, condition, condition. Your hair is likely dry and damaged, plus you've just put it through torture. Use a deep-conditioning treatment on your poor locks to help replenish them and prevent future tangles.
If you've tried your best to get those mats out and some won't budge, you may have to cut this bit of hair. See a professional stylist for this so she can ensure you get the most professional-looking results and not look like you got hacked by Edward Scissorhands.
Don't ever start whacking a brush over your tangled hair. Getting tangles out can get frustrating, but if you don't do it right, you can seriously damage your hair and even pull chunks of hair out. Yikes!