Optimally you want to be in position while your opponent is out of position. More often than not, this will give you a short ball that you can attack, going for an outright winner or a way to the net for a put away volley.
One way to achieve this is by hitting the ball on the rise and positioning yourself further in the court. This will achieve giving your opponent less time to recover in between his shots. It will also dictate how much ground you will need to cover. Take a walk on the tennis court and count how many steps you will need to cover a wide ball if you stand 12 feet behind the baseline versus 1 foot behind, where you can cut off the angle. So during your baseline rallies try not to drift too far back.
Another benefit from this position, apart from not getting exhausted, is that you will be ready to attack a short ball.
Now, as we all know, tennis is not that simple. There are occasions when your opponent is hitting the ball more forcefully than you would wish. You're pushed on to your back foot. You're late hitting the ball. He's got you off balance. This can happen in rallies or on returns of serve. If you find yourself struggling to adjust to your opponent's pace, take a half step back to give yourself a fraction more time.
By the same token, if someone is hitting the ball unexpectedly short, try positioning yourself further in.
Remember that a tennis match needs a lot of experimentation and adjustment. Not many opponents are going to hit the ball straight to you and it's up to you to find a strategy that provides the best positioning for you.