It’s the timing of your swing, you have to swing when the ball is at its highest point.
You just have to time your swing at the ball's highest highest point. There's not much more to say really.