What to do if pan/pot is burning (with or without food)
Letting it cool slowly will minimize the chance of warping for thin or cheap cookware.

Quality cookware should stand up to being deglazed or quickly cooled under running water.

How you cool it is up to you.

Note:  the above is based on metal pots and pans.  Glass, ceramic, or earthenware pans should always be cooled slowly to prevent heat-stress breaking or crazing.