Being able to hit the ball in the center of the driver face is something all golfers aim for. There are several things that will affect your swing which can be anything from your grip, stance, to the pivoting of your hips. In some cases the flexibility of the shaft also comes into play as the driver head tries to align with the shaft on the down swing, impacting the loft at which the ball is struck.
There is no exact science for hitting the ball correctly as each golf player swing is unique to them, although there are some mechanics I mentioned before that you can focus on which will generally improve your swing. Hitting the ball in the center of the driver face though is often trial and error by experimenting with the different tee heights that will give you the best and consistent shot. The height of the ball on the tee usually affects where the ball will impact the driver face, this directs how high and how far the ball will travel based on the loft angle the ball is struck and the amount of spin the ball generates.
Often overlooked is the angle of the driver face and where the perfect hitting spot is. If you are using a 10.5 degree driver, it means that the 10.5 degrees is roughly in the center of the face, hitting lower than the center the loft decreases, causing the ball to fly lower with more spin and the opposite for when you hit the ball above the center. Sometimes the ball is hit too high on the face that you can see the marks on the top edge of the driver, this normally means that the tee you are using is too high. For a visual representation of how to hit it properly, an article by Hirekogolf shows it very clearly all the way from the driver face to hitting up or down on the ball.
The most common used tee setup is to have half the ball on the tee above the top edge of the driver face and the other half of the ball below it. This would be a great starting point to try and figure out where you need to go from there. If you still hit too high on the driver face, then the tee could still be too high. Experimenting enough should get you to the proper height that is perfect for your swing. If it feels like you are swinging a hosepipe, try hitting with a driver that has a stiffer shaft, this might help hitting the ball more accurately rather than trying to compensate for the bending of the shaft which can end up opening the driver face on impact, resulting in a slice or a hook shot.