If you burn yourself on a hot pan or the side of the oven, the first thing is to immediately cool the burn with cold running water or ice. Here's a nice summary from Mayo Clinic about what to do next.