The most common cause for misadjusted wheels are accidents and lack of maintenance. Replacing a rim is much easier than building a wheel from scratch. Buy a new rim with the same number of holes and the same inner diameter. Avoid black-anodized rims because the anodizing will rub off after a while. Always use aluminum rims, never use steel.
Steel is hard to true and brakes poorly even with special brake pads.
Place the old wheel flat on a table and tape the new rim to the old one, making sure that the valve holes line up. Also make sure that the spoke hole pattern lines up if the holes are alternatingly offset left and right from the center. Next, loosen all old nipples but do not completely unscrew any of them. Beginning with the spokes ending at the flange facing up, unscrew the nipple and move the spoke to the new rim, one at a time. A few turns of the nipple suffice.