Examine the door edge and frame. The two should sit parallel. If not, the door is out of alignment. A loose top pivot can cause the misalignment. Loosening the screw in the top pivot bracket and sliding the bracket until the door is aligned with the frame may fix the problem.
Look at the edge of the door bottom and along the frame bottom. Any worn edges or marks indicate that the door is binding at the bottom. Adjusting the bottom pivot may fix the problem. The bottom pivot releases from the bracket if you push up on the door. Twist it to raise or lower the door until it appears level.
Spray a lubricant spray -- silicone is usually recommended -- on the top track. Dry or corroded hardware can prevent the door from operating smoothly. The only way to find out whether the hardware is dry is to moisten it and test whether the door closes smoothly after application.