Start by taking a few measurements with a tape measure. You would need to measure the top and bottom lengths of the sliding closet door opening as well as the vertical length on both sides. Keep your measurements as precise and accurate as possible because getting the measurements wrong could mean that the door would not fit in the tracks.
Depending on the measurements you took in the previous step, determine the size of the doors you will need to purchase. Be sure to take along the readings when you go shopping for the new sliding doors.
Before you actually attempt to install the doors, make sure that any required preparation work has been taken care of. For instance, you might have to paint a door or remove any hardware that was attached to the opening.
You will now need to install the tracks for the door to slide in. Install the top track first using a cordless drill and screws. Use a level to make sure that the track you installed is perfectly horizontal. If a modification is required, consider using a shim to adjust the level of the track. Install the lower track in a similar manner. It is the bottom track that will keep the sliding door from popping out.
It is now time to install the sliding door. This can be accomplished by first attaching the rear end of the top of the door to the upper track followed by the front end of the top of the door. Attach the bottom of the door in a similar fashion. Finally, hide the tracks by embellishing them with decorative moulding if desired.