Ensure the pan is hot and you have added enough oil or butter. The easiest is to use a pan with a non-stick coating. And when you loosen the edges of the egg with a wooden spatula, it comes off easily.