Cooking with a lid and a pan can lead to a stuck lid. The steam and heat produced during cooking creates a vacuum between the pot and the lid, causing the lid to stick to the pot. However, lids can become stuck without heat being the cause, and there are actions you can try in either situation.
Fixing a Vacuum-Sealed Lid
Once you realize your lid is stuck, remove the pot from the heat source. Continuing to cook with a stuck lid will only reinforce the vacuum, as it is a result of the difference in temperature inside and outside the pot. Too strong a vacuum can warp some lids and pans. Try removing the lid by hand, wearing oven gloves to protect from the heat. If this does not work, place a steaming hot towel on the lid for a couple of minutes to raise the outer temperature. Try removing the lid again. Repeat as necessary until the lid comes off.
Fixing a Tight-Fitting Lid
To remove a stuck lid because it is tight fitting -- not because of a vacuum -- cool down the metals significantly. Cooling the pan and lid will cause the molecules in the pan to contract, making the lid fit less tightly. Stick the pot in the freezer for 20 to 30 minutes. Try removing the lid with your hands. If this does not work, take a wooden spoon and tap firmly around the rim of the pan and then the bottom of the pan, before trying to remove again. If the lid is still stuck, repeat all steps until the lid comes off.