Before you start leveling your floor, you'll need to eliminate surface imperfections. Use a claw hammer to remove nails or carpet tacks embedded in your boards. If you can't get any up, hammer them below the surface of your floor. Use warm water, detergent, and a scraper to remove old glue. When you're finished, vacuum and wipe over your floor with a mop.
Rent a heavy-duty drum floor sander and an edging sander. You can level your floor by using these to iron out any peaks and troughs in your floor. Use a bubble level to monitor your progress and judge where additional work is needed. Start in one corner of your room and work your way along the length of your floorboards with the heavy-duty drum floor sander before attending to the perimeter of the room with the edging sander.
You can buy self-leveling compound to fill in the troughs in your wood floor from hardware stores and online. Look for a product that matches the color of your planks if your boards aren't being used as a sub-floor for another flooring product. Most self-leveling compounds come premixed and can be poured into any dips in your floor. You’ll need a trowel and a bubble level to remove any excess compound and make sure the area you're working on is level.
If your wooden floor is being used as a subfloor, you can lay a thick underlayment product to absorb any imperfections before you lay your new flooring. This solution should only be used on subfloors that have slight imperfections and in line with any instructions from the manufacturer of your new floor.