There are two fundamental ways to escape from most pinning positions: escapes based on ‘shrimping’ style hip movement, and escapes based on bridging.
One common mistake I see among beginners is that they hold the bridge position for far too long. As they struggle to escape from a pin they keep their hips a few inches off the ground, maintaining in a low bridge. Maintaining this bridge does nothing to help them escape, and it also burns a lot of energy, especially if there is an opponent on top of them trying to pin them to the ground. Basically you should either be dynamically bridging, OR trying another escape, OR resting.
As with all rules there are some exceptions. You may decide to hold the bridge position for conditioning (as they do in Yoga). Additionally there are also a few choke and neck crank attacks that can be countered, to some degree, by keeping your hips elevated in a static bridge position. These are specialized situations, however, and the general rule of not statically holding the bridge in sparring is a good one to start with.
If you are a beginner try to figure out if you are making this mistake or not. If you are a more advanced player watch for other people making this mistake and point it out to them; the faster they improve the skills the faster you will get some new, high-quality training partners.