If a rim is not a flat disc it will appear to move from side to side as it passes through a rim brake or goes by some other index point. You can true a rim by adjusting the spoke tension.
Diagnose where to true the rim
Watch the rim carefully and move the index point so that it just drags on the rim at the extreme point of it’s buckle. Use the barrel adjuster of a rim brake to reach this point. To true a rim is much easier if you have a wheel-jig.
Spread The Load
You true a rim by tighten opposite spokes all along the buckle tightening the ones in the middle more than those at the end. Make small adjustments don’t give any spoke more than a half turn before checking and re-diagnosing.
Make The Test Harder
As the rim improves tighten the brake or move the index point to find a new position where it drags on the rim.
Stress The Spokes
Between each round of adjustment and re-diagnosis stress the spokes using the procedure checking spoke tension and squeezing hard. This releases any twisting forces trapped in the spokes. If you don’t do this the forces will be released the first time the bike is ridden and the wheel may go out of true straight away. This stressing process is the main difference between a hand-built wheel and one built by a machine.
If you can’t get the rim straight without very uneven spoke tension the rim may be damaged beyond repair and need replacing.