Measure the straight sections of the wall with a measuring tape. Add them together to determine how much baseboard is necessary. Round the total up to the nearest foot that can be divided by two.
Cut the baseboards with a miter saw. Add three inches to an end that meets an outside corner. This allows you to cut it to fit later.
Turn on the stud finder and drag it slowly along the baseboard area to locate the studs in the wall. It beeps or has a light that comes on when it finds the stud. Indicate the studs with a pencil mark. This allows you to nail the baseboards on the studs.
Position the baseboard against the wall to see if it leaves any gaps between the baseboard and wall or in between the baseboard and floor. These gaps are where the wall is not straight.
Nail the baseboard into the wall with nails and a hammer at the studs.
Squeeze acrylic latex caulk into the gaps in between the baseboard and wall or between the baseboard and floor area. Typically, the caulk comes in a squeeze tube that you can squeeze with your hand or you can use a caulking gun with a canister if you prefer. Use caulk that states it is suitable to paint over. Fill the gap completely by allowing some caulk to ooze out.
Wipe off the excess caulk with the tip of your finger. Clean any caulk residue off the baseboard with a damp cloth. Allow the paintable caulk to dry completely according to the instructions.
Paint the caulk with a latex paint to match the baseboards and no one will ever know your walls are not straight. Apply the paint with a quality paintbrush.