Remove the closet doors, if needed, to provide you with enough room to access the bent spot on the track. Follow the procedures to remove the doors according to their design.
If the track is bent inward and stops the doors from rolling past that point, grip the bent section of track and pry it outward with a pair of pliers.
If the track is bent outward, position a small wooden block against the bend in the track, with the jaws of a pair of adjustable pliers wide enough to enclose the track walls.
Squeeze the track walls with the pliers, and bend the track straight against the block of wood.
Hold the wood block in place with one hand, if the track is too firm for you to reshape it with the pliers. Place one foot on top of the block to steady it instead, if you are repairing a floor track.
Hammer the bent track against the wood block to straighten out the track.
Reinstall the closet doors, if necessary. Slide the doors open and shut, to ensure that they move smoothly.