In a perfect world, every skein of yarn is a perfectly arranged series of loops, ready to be unwound with no trouble whatsoever.
Unfortunately, this is not a perfect world, and after going through the rigors of a dyebath or after being mangled by children, cats or other calamities, you might end up with a tangled skein. Maybe even a severely tangled skein.
You have three options now. Option One: Throw that lump of loops into the rubbish bin. Yes, that is a valid option - if you don't really need that yarn, if you can buy it again, if you don't have a lot of patience, if you are not really willing to untangle it, if it's wool and has felted itself together in the tangling process, so that pulling apart the loops will damage the yarn. If it's one-of-a-kind or it was horrendously expensive, though, you might not want to throw it away. Luckily, there is Option Two: Figure out some way to use the yarn that does not require it to be all in one piece. Draw out as much yarn as possible at one time (or your pre-defined lengths), cut, untangle the knob that forms, repeat until skein is gone and you are left with a number of one-length cutoffs. Take care to wind each cutoff after measuring it and cutting it, or you might face more tangles!
That is not the thing you need? You really want one long length of yarn? Then take a deep breath, go buy some chocolate, put on a kettle for some tea and sit down for some lengthy yarn skein de-tangling. To get an estimation of how long it will take you, make a wild guess. Then multiply the time of your wild guess by two - that's the pessimistic wild guess. Now multiply that by ten, and you have an estimate. (Seriously, if you are pressed for time, this is not an option. Go buy another bit of yarn. And if you are not patient in the face of tangles, find somebody who likes to untangle yarn and bribe that person.)
You will wind the skein into a ball of yarn by hand, or, if it is very fine yarn, you might opt to wind it onto something like the core of a paper roll. You will not be able to use a ball winder or similar contraption. There is nothing speaking against making a center-pull ball, if you can wind one by hand, though (and there are instructions galore on how to do that on the internet).
Try to find the original middle of your skein. If it is still bound off, that should be no problem - just locate one of the bind-off yarns, hold that and insert your hands between the bottom of the skein part with the bind-off and the mass of tangles. If your skein is not bound anymore, hope for the best. Open up your skein gently but completely and gently stretch it between your hands. Stretch it all the way around, rotating it bit by bit and stretching after each little rotation - this is to straighten out the loops as much as possible.
Now you place it on a good swift - one that is turning lightly, that does not have much weight on its own, and that has as many arms as possible. If you don't have a swift yet, it's the reason to get or make one (if you sit down to untangle a skein, you are probably a yarny person and you want a swift anyway). If you have a four-armed swift and face tangles often when unwinding, consider getting one with more arms, and if possible with arms that have a wide surface for the yarn to rest on (like the Goko). The higher the number of arms, the more your skein on the swift resembles a circle - and it's much easier to wind off a circle than a rectangle, because the corners are where yarn likes to catch itself.
Once your yarn is on the swift, spread it out as much as possible. Locate the end of the yarn - if possible, the end lying on the outside. Your skein is technically a huge spiral, and it's easier to unwind that from the outside than from the inside. In a skein that is tangled, the loops of the spiral have gotten into disorder, locking each other into place and hindering you from unwinding. Your task now is to straighten out those loops.
Now you are going to face two different kinds of tangles. (If you are working with wool yarn, the yarn might stick to each other as an additional, third kind - a pseudo-tangle.) You are winding your working end, and suddenly it won't detach itself from the surface of the skein - instead, many short bits of yarn seem to tie it down to the swift, forming a sort of small triangles. Those are loops locking each other and the working yarn - insert your finger and gently pull upwards, or try sliding your finger in the opposite direction of your winding direction. That should release the small triangles. Each of these triangles is a loop of the spiral, where one bit has been caught by other loops, locking it in place. The bit a little more "upstream", so to say, overtakes the bit that is caught (using up the slack in the yarn at the same time) and forms the apex of the triangle. To remove the triangles, you need to free the spot that is caught - if you move your finger "upstream" (against the winding direction) underneath the triangle, you will find that point. Gently tug on the leg that is caught in downstream direction to release it.
Typical "catch-points" are the arms of the swift, because this is where the skein turns a corner. The larger the angle of that corner, the easier it is to turn it for the yarn (that's why more arms make a difference). If something is caught at a corner, insert your fingers beneath the skein and flatten out that corner while gently pulling on the yarn end(s) caught - this should release them.
Once in a while, however, a single loop or a number of loops will form around your working end. If you slide your finger under that loop, back where it comes from, that loop will turn out to be one really big version of the small triangles of yarn. If you can go back to the point where one leg of the loop is caught in the skein and gently tug it free, do so and gently travel underneath that free leg with your finger to where your working end was caught - that will remove the loop completely. If your loop is really big and goes around and around the swift, you can in theory follow the loop until you find the end that is caught and release that in the same way. In practice, however, it is much easier to just cheat and move your ball or spool through the loop. This means you have now changed the run of yarn - it is not an unbroken spiral path anymore, but might contain one half-hitch knot. Never mind that, just be aware of it - because it means that you will eventually find yourself caught in a loop again and have to move your ball through it.
If you run across any bad tangles, always try to tease them apart with your fingers, leaving them more loose than you found them. If you can't get your yarn free from a badly tangled place, just move the ball through and move on. It will all get sorted out eventually. Spread your skein from time to time (if your swift has wide arm-ends) to help with unwinding. Take breaks when you need to - and don't make yourself finish in one day. Instead, I'd recommend placing your swift somewhere easily accessible (and with very good lighting) and just untangle a bit at a time. Don't try to untangle when you are angry, stressed or impatient, and most importantly, don't think that you need to do it fast - and the whole business can even be a soothing, meditative thing.