Entrapment can be avoided by staying away from strainers, sieves, undercuts, and proper swimming techniques if you come out of your boat. Don't try to stand in fast current up to your thigh area, chances are you will get swept downstream out of control. If you have an older boat, make certain the walls are very secure so it is unlikely to collapse. When purchasing a boat, make certain it has a full bulk head for your feet instead of foot pegs that were common on older boats. Make certain throw ropes are stored properly and carry a rescue knife in an easy to get at position on or in your PFD. Just like skiing, stay in control. If the run is too difficult, portage the tough rapids or walk out if necessary. Here is a good article describing foot entrapments.
Foot entrapment rescues can be really dangerous. A combination of a stabilization and snag lines may avoid a hands on rescue but this is very tricky to pull off, especially the weighted snag line. Another alternative is the saw method. Run a line at water level downstream of the victim. Wade into the deeper water on both ends and pull back and forth pressing downwards. This approach is much faster and has a higher chance for sucess than the weighted snag line. Most of the time, someone needs to go out to the victim. Be very careful with footing so you don't fall into the same trap. Use a rescue vest and secure a line to your tether as an extra safety precaution. Stir the bottom with your un-weighted foot to find the next safe place to plant your foot. If it grabs it should be easy to pull back out. Once you make it to the victim, you should be able to pull out an entrapped foot fairly easily. To unpin a boat, have someone hold the victim's body to stabilize and try to back out the boat or loosen one end depending on the pin.