Inspect the floor for any damaged boards and for any nails that are sticking up. Replace boards and pull or hammer in the nails as necessary.
Use a coarse grade on a large barrel sander to sand the floorboards in a diagonal direction, moving from one corner of the room to the other. Do not lower the sanding drum onto the floor until it is running at full speed, then move the sander at a steady and consistent speed. Tilt the machine back so the drum is off the floor, then turn around and go back diagonally in the other direction. Continue until you have removed any paint, stains or dirt from the boards. Sand the edges and corners that cannot be reached with the barrel sander by hand.
Inspect the floor boards again, and use a wood filler of a color that matches the floor boards to fill any holes in them. Apply it liberally with a paint scraper.
Sand the entire floor again, using a finer grit sand paper to produce a smoother finish. Sand in a direction that goes with the grain of the wood this time, rather than diagonally.
Apply a first coat of quality wood sealer using a lamb's wool applicator, applying it in the direction of the grain. A paintbrush works well for corners and edges. Follow the directions on the sealer regarding the amount of time to wait between coats, and then apply a second coat. Allow the sealer to cure for 48 hours, and your job is complete.