On cooking shows I always see cooks using ordinary pans without non-stick coatings, and nothing ever seems to stick to their pans. But when I try the same recipes at home, my food always sticks.
What can I do to prevent sticking?
It depends some on technique, and some on what you're cooking. And it depends on your definition of "sticking."
Foods that are high in protein (especially those low in fat) are more prone to sticking. So a really lean white fish, which is almost all protein, will want to stick. Likewise, egg whites can stick. To some extent, almost any food that doesn't have a generous amount of easy-rendering fat will want to stick, but higher protein is more sticky.
To counteract this tendency, you need to compensate by putting some kind of fat (usually butter or oil) into the pan in advance of the food. Most people seem to get the best result by preheating the dry pan some, then adding the oil, letting it get up to temperature, then adding the food.
That's the simple summary, but it can get you pretty far.
There's another thing you might run into as well--high-protein items that stick at first will release on their own if you let them cook long enough at reasonably high temperature. So if you throw a steak dry into a hot pan, it's going to stick at first, but as the Malliard reaction occurs (that nice brown crust we love), the steak will actually release from the pan (or mostly release) of its own accord--usually after 3 minutes or so at high heat. The same is true of most meats, but with delicate ones like fish you're probably better off providing more fat/oil than counting on an easy release as the proteins denature.
Finally, what's your definition of "sticking?" If your food literally sticks to the pan, then the technique I gave in paragraph 3 above should help you out. If you are able to move your food around, but find that little bits stick to the pan and turn brown, that's to be expected. That's called "fond" and most people try to retrieve those delicious browned bits by deglazing (putting in a liquid and stirring/scraping as it boils down) and making a pan sauce. And even if you don't want to make a pan sauce, you can clean those stuck brown bits off by putting just a little water in the pan and bringing it to a boil. Scrape the pan with a wooden spatula (or even a regular spatula if you're gentle) while the water's boiling and stuff should come right up.
Depending on the type of pan you're using, you may need to "season" it. If you've got a cast iron pan, even if it came "pre-seasoned", you probably need to improve the seasoning before it works as well as it can.
As discussed in other answers, food sticking isn't all bad. You don't want things to stick and burn, but without any sticking, there's not much browning that happens.
This answer is coming far after the original post but I think I truly have the key to this question. All above answers are correct but missing a key part. First off I work in a high volume restaurant where we pan roast all types of fish and meat in aluminum pans. There really is only one way to be able to cook a half chicken skin side down or a piece of king salmon and have it come off clean without introducing a liquid. The key is to get the pan extremely hot with nothing in it. Once your pan is almost smoking be ready with the oil and your protein. Add enough oil (one with a high smoking point, olive May not be your best choice) to cover the bottom and immediately carefully place your protein into the pan, always dropping it away from you to prevent splatter. Now carefully give the pan a little shake or a swirl and your protein should just glide around the pan. At this point turn your stove down and return to heat. I promise you this will work every time. Essentially what is happening is you are instantly searing and drying the outer edge enough that it won't be able to grab and stick to the pan. Hope this helps someone!
First, you can use a seasoned cast iron pan. In restaurants, the chefs always -- there are some exceptions -- start with a hot pan with hot oil before they add ingredients because this often prevents sticking.
For a cast or plain steel (not stainless) pans, the surface needs to be conditioned. Only buy pans with a smooth surface regardless of price. Then use metal scourers and spatulas to remove any rough spots. And then regularly heat with oil until it smokes
For proteins, with a conditioned pan, pour in a layer of salt and heat until the salt discolours, discard salt, let cool a bit, roughly wipe out with paper, add a little oil, and cook as normal. This removes any sticky, non-polymerised oils, and stop proteins having something to stick too. With a well seasoned pan properly cleaned this way you will find it better than a coated pan
For carbohydrates, there is not much you can do other than use more oil. Even temperature control, and cooking them as low heat as possible will help
Here is a teaching resource from the Royal Society of Chemistry on the chemistry of pan-sticking.
This is what they say about why food sticks to pans:
Sticking is caused by chemical bonds forming between the food and the material of the pan – almost always a metal. These bonds may be relatively weak van der Waals forces or covalent bonds. Protein-rich foods are particularly prone to sticking because the proteins can form complexes with metal atoms, such as iron, in the pan.
They go on to say:
Before non-stick pans were developed, good cooks could still avoid sticking. One simple way to do this is just to keep the food moving so that it is never in contact with the pan long enough for chemical bonds to form. Eventually the proteins on the surface of the food will have got hot enough to react with something else, after which sticking is not a problem. This is what happens when meat browns, for example. Another method is to heat some oil in the pan before cooking. The oil, being liquid, fills in the valleys and caves of the pan surface and when it gets hot it reacts with the metal atoms of the pan and forms a coating called a patina. This leaves few free metal atoms to react with the food. This coating can easily be removed by detergents, however, so it has to be reapplied before each use of the pan.
From personal experience, the "get the pan hot and keep the food moving" technique works fairly well. For example, I cook omelettes in a stainless steel pan using Julia Child's method, which is to get the pan hot then add the oil/butter followed by the egg and briskly slide it around the pan for 30s before turning out onto a plate.
Also from experience, the quality of the pan surface makes a difference. Food sticks less to a new pan with a smooth surface than one covered in blemishes.