Generally, you can't fix a bent rim. It will need to be replaced and the wheel re-spoked. If it's only slightly out of round/bent it's usually possible to get it true again by adjusting the spoke tension. Tighten spokes where the rim is too far away, and slacken spokes where the rim is too close. Work in small steps.
Bigger changes can often be fixed by unlacing the rim, bending it flat, and then lacing it back into the wheel. Keep in mind that this might weaken the rim enough to make it unsafe to use.