One of the most controversial topics in tennis is the so-called "split-step." All tennis pros have their own methodology concerning this. This "split-step" is very, very important to your improvement. In general, just before your opponent strikes the ball, you should widen your stance and slow down or stop. This allows you to get to a neutral balanced position. Now you can wait until you are 100% sure of which way to go for the next shot (up, back, sideways, etc.). A problem that often occurs is that a player will always tend to favor one side or the other (by leaning). They will not only do this with their feet, but also with their racket direction. For example, if you allow your weight to go to one foot, then you are committed to that direction. If you allow your racket to favor a forehand or a backhand before you get enough information, then you are committed to that direction. This commitment too early is a great source of poor mobility and unnecessary injuries.
To fix this problem, remember to slow down or stop with a wide base, right before your opponent hits the ball. Keep your racket in its normal ready position. Try not to favor one side or the other. Also, remember, as soon as you perceive the correct direction of the next shot, go to the ball. Do not allow the ball to come to you. A correct understanding of the split step will place your body in a more balanced and neutral position. Also, it will stop a myriad of injuries caused from guessing where the ball is going and having to contort your body to go to the ball. To be a great competitive player, performing a split-step should be second nature. You might need to think about it at first, but soon you will be doing it automatically.
Good luck on the courts!