You need to first check local codes, some municipalities require you have this done by a licensed electrician. Most of the time, the power company will pull your meter for you, then put it back when you're done. But, often they won't put it back without an inspection, so, again check before you start.
I'll often mark wires on the outer insulation with a sharpie ( felt tip pen ). I usually just mark them with 'A', 'B', etc., then write down on a pad of paper where each goes. Also, mark each wire in a couple places in case something gets rubbed off. Disconnect the individual wires for given piece of Romex, then remove the nut holding the box connector in the panel (the clamp that holds the wires going into the panel. Carefully pull that wire out, just be careful not to nick the insulation on any sharp edges. 'Rinse and repeat' until all the wires are out.
Next disconnect the 'big' wires from the main breaker and the ground buss(es). Then you should be able to remove the old panel. Again, be careful not to nick the insulation. Note that you might need to run new wires from the meter base if the old ones are too short for the new panel. Also, if the new panel's main breaker is a higher amperage than the old one, you'll likely need to replace the service entrance with one of the proper rating.
Just reverse the process to connect the new panel. I probably left a few things out, but, hopefully others will fill in the blanks if I did.