I have often talked about how we tend to gravitate towards whatever is comfortable on the tennis court.
Many times, this means serving, returning and then recovering to the middle of the court about a few feet behind the baseline to exchange groundstrokes. A good opponent is likely to try to take you out of that comfortable position by getting you on the run, moving you side-to-side, hitting the ball high and deep, or by hitting up in front of you. They may even come into the net just to keep you from playing in the comfortable baseline exchange situation you are hoping for.
Players need to get better at hitting balls from right on the baseline, inside the baseline, and also out of the air. These are all things that can be practiced. I like to play a game where all players must hit the ball from on or inside the outside lines of the court. If both feet end up outside the area that a ball can land and be "in", that player automatically loses the point.
Try challenging yourself to hit from awkward positions in practice—move forward if you like staying way back, or stay back if you prefer to rush the net. Try to survive the uncomfortable feelings you encounter when you aren’t in your optimal position on the court.
I recommend starting this learning process at a young age since the balls are generally going slower which will enable the player to grow into the strategy of expanding their play to all areas of the court.