Protect yourself. Wear comfortable, sturdy shoes to protect your feet from rough subflooring, loose staples and any other debris. If dealing with old tack strips and staples, wear heavy work gloves to protect your fingers. Pulling out old carpet staples can be time-consuming and hard on your knees, so invest in some kneepads to protect them.
Protect others. Keep small children and pets out of the room while you work so they don't get hurt.
Clear floor of any staples or nails. Pulling up old carpet padding will leave a mess of staples still embedded in the floor. They'll be easily spotted by the tufts of padding that are trapped underneath. You want the smoothest possible surface for your new carpeting, so it's worth the extra time and effort to pull these staples out. You can use a heavy duty staple remover, or a screwdriver and pliers. Use the screwdriver to pry up the staple, then the pliers to pull it the rest of the way out of the floor. Keep a trash can nearby so you can drop the staples directly into the can.
Flatten the floor. Particularly in newly built homes, there may be globs of paint or joint compound stuck to your subflooring that the contractors just carpeted over. Use a scraper to level these areas out. If you're carpeting over linoleum tiles, be sure to glue down any loose edges. Patch up any cracks and fill in valleys in a concrete floor. For concrete and ceramic tile floors, you should consider consulting a professional. Some experts believe in evening out all the grout with leveling compound before laying carpet, which is a tricky job for a novice.
Pull out any defective tack strips. Old tack strips can be re-used, but if the wood is rotten or stained, use a pry bar to pull it up. If you have a professional carpet installer coming in, they probably won't be as picky about the condition of the tack strips as you are, so don't count on them to replace the damaged pieces with new ones. If there's a gap from the old strip you removed, then they'll put a new tack strip in place.
Clean the floor. You can use a broom and dust pan or shop vac to clean your floors of dirt, debris, and old staples. Do NOT use a house vacuum, as chunks of plaster, wood chips, or staples could irreparably damage it. If the tile floor is especially dirty or sticky, feel free to mop with an all-purpose cleaner, but make sure the floor is completely dry before laying down new carpet. Moisture can ruin your new carpet and padding.
Replace any damaged subflooring. You may have had a bad spill, severe pet damage, or a window leak. Cut out any compromised flooring and replace with a new piece of matching subflooring.
Clean or paint the baseboards. This is the easiest time to get your baseboards fixed up. Clean painted or sealed baseboards with a mixture of all-purpose cleaner and a little bleach. Make sure the cloth is well wrung out and doesn't drip heavily onto your subfloor. Use a good semi-gloss or gloss paint to freshen up your baseboards and make them easy to clean. If you have problems with pet odor or damage, consider priming/sealing the baseboards before painting.
Seal the floor. If you have minor damage to your wood subfloor from pets or spills, it's a good idea to brush on some primer/sealer over these areas to seal in odors and protect your new carpet. For concrete floors, you might consider a concrete sealer to protect the surface from moisture and wear.
Make sure everything is dry. If you're working in humid conditions, you might want to use electric fans to help dry a recently mopped floor or painted baseboards. Just be sure the fans are clean so you don't blow dust and dirt onto your fresh work. If you have problem damp areas on your concrete floors, these issues need to be resolved before you can lay down your new carpet.