The most important factor in getting unhung is to get over the top of whatever you are hung on. You want to make sure you keep your line high enough that it won't get wrapped around a different tree (or other object) on the way to the tree that you are hung on. So, be sure to travel towards the hang-up and with your line relatively tight and high. Once you get over the bait, there are several ways you can get unhung.
If you can reach the lure with the rod, simply reel the rod down to the bait until the rod tip touches the bait. Then give it a quick jab downward and it will usually pop off on the first try.
If you can't reach the lure with the rod and you have a weight near the hook, such as on a jigging spoon or pegged Texas rigged worm, you can use the weight of the bait to get it off. Simply get over the bait (try to go over it on the same side that it hooked on) and lift the bait slowly and let the bait fall fast. The trick is to use the weight of the lure to knock it off. You want to avoid bending your rod. Any time you bend the rod, you are digging the hook into the object. So drop it hard and lift it easy. You may have to do this several times. But if you have a heavy enough weight, it will normally get free. I often amaze my clients when I lift my rod up and down 50 to 100 times and it eventually does get off. If it is hung in wood, it will usually get off. If it catches a trot line or some strong fishing line, you may not be so lucky. I can usually tell the difference, so I don't waste much time.
If you can't reach the lure with the rod and you don't have enough weight to pop it off, you will need something heavy to do it. You can use a lure retriever, a heavy sinker, or even a spark plug. If you have a lure retriever or a spark plug, wrap it around your line and let it slide down and do the same as you would with the jigging spoon. If you use a spark plug, you will need some pliers to bend it around the line. If you don't have a lure retriever or a spark plug, cut your line and slide a heavy barrel weight down it. It will usually work, but you will lose some line. If I am using 15# test or less, it doesn't bother me to lose some line. However, if it is heavy line, losing that much line could make a difference in how well the reel casts.
I make my own lure retrievers that are more convenient, compact, and cleaner than spark plugs. They are basically a 2 ounce river sinker with a swivel type snap. If you are interested in buying some, I sell them for $2 each. Shoot me an email or call if you are interested.