A lot depends on the exact circumstances of the situation. How unevenly matched are the combatants in size and strength? What are the stakes (pain, humiliation, injury, death)? What are you prepared to do to remedy the situation?
Some things are pretty straight forward.
Make certain your airway and blood-flow is clear. If they aren't, you can thrash and twist your body while pulling at the restraining arm to loosen the choke and give you room to breath. Once you can find room to, drop your chin to your chest to prevent the assailant from reestablishing the choke.
If you can reach one of your assailant's hands you can peel his grip open and/or use a finger lock (or break) to forcefully disengage their grasp.
If you can reach your assailant's face or neck you can gouge an eye or apply pressure to the suprasternal/jugular notch (these are vulnerable targets no matter how muscular an opponent is). Keep in mind these are targets which could maim or kill someone if too much force is applied. The goal should be preserving your safety through measured application of force, and not causing needless suffering.
If the assailant's mass isn't overwhelmingly more than your own, you can use your heels to hammer at the side of their knees or instep of their feet. You can also drive with your legs toward the assailant's body to unbalance them and/or hook one of their legs with your own to sweep them. Most of the time a falling assailant will disengage to try and break their own fall.
If life and limb are on the line, use every tool at your disposal to defend yourself. This includes your teeth. Most people are not psychologically prepared to be attacked savagely by a human bite, but they are an excellent weapon of last resort. As omnivores, our teeth are pretty good at tearing flesh. If it ever comes to using one's teeth in self-defense it is important that you fully commit to the action. Using one's teeth in this manner is almost certainly going to be considered an escalation in violence, and if an assailant wasn't trying to seriously harm or kill you before they may consider doing so after. If you are going to bite someone in defense then you need to do so effectively. The bite target should be fleshy enough to get ahold of with your canine teeth/cuspids. A restraining forearm is a good example. Don't bite down straight on, but do so with the front corner of the mouth placing a set of cuspids as deeply into the assailant's flesh as possible. While maintaining strong bite pressure, thrash from side to side as hard as possible to try and tear the soft tissues. Doing so will be incredibly painful and psychologically traumatizing to the recipient of the bite. Reapply bite and repeat as necessary until the assailant is subdued and/or you can flee for your own safety.
There are of course many, many other techniques one can use to get out of a choke or headlock, but a lot of them require some degree of specific technical training.