Check to see if the rollers on the bottom of the door are on the track properly.
There should be adjustment screws either on the face of the door(might be hidden with plastic buttons) or the side edges.
These screws adjust the rollers or wheels up or down.Try turning(clockwise)2 or 3 turns then slide the door back and forth.As you lower the wheels the door will raise and should make it slide smoother.Repeat turning the screws a few turns and sliding the door back and forth until you get it where you like it.
Now make sure the door closes and locks.You may need to adjust the wheels a little more so the door is square with the jamb and closes properly.
If the adjustment screws don't raise the door or it still won't slide smoothly after it does raise, the wheels might be worn(if nylon) or the wheel assembly needs repair.Any lumber yard or homecenter that sells your brand of door should be able to get replacements.Luck