Open the door all the way. This reveals the majority of the track, both top and bottom, that needs cleaning.
Scrape out any visible dirt. Use a plastic putty knife and scrape away dirt and debris. A degreasing cleaner helps move stubborn pieces of dirt. A toothbrush can scrub away the dirt. Wipe the racks down with a soft cloth. Try the door again.
Spray a silicone-based lubricant on the top and bottom of the track. In many cases, the oil in the door has simply worn down, causing it to stick. Hold the can 6 inches away from the track and give it a light coating. Open and shut the door. Repeat this as necessary whenever the door sticks.
Vacuum the tracks weekly. Make cleaning the track of your sliding door a weekly event. A vacuum host attachment will work, or use a cloth and some cleaner and clean it by hand.