The first skill I teach in every class and at every lesson is how to control your camera's autofocus. I have a three-step method that outlines everything you need to know about using autofocus.
My first piece of advice is to be intentional with your camera settings. Know why you're choosing a certain setting based on the photo you're creating. Your camera can't read your mind or your scene. Take control and tell your camera what to do.
With autofocus, there are three separate steps to taking control.
First, before your press your shutter, select your autofocus point. Almost every person I teach has their mind blown when I show them that they can actually control their camera's autofocus point selection. Stop using an automatic selection mode and use single-point manual autofocus point selection.
(Okay, some of the latest cameras have such amazing facial recognition that soon this first step will be obsolete. However, even with advanced technology, you should learn how to control your camera. That way, you can take over when the technology fails you.)
Second, when you press your shutter halfway, decide whether the autofocus point will focus once or continuously. Third, decide whether pressing takes one photo or multiple. Why choose continuous autofocus? Why take multiple photos?
I describe these three steps in much more detail in my article here at Photographers' Cooperative. I have diagrams and details, so click the link and read more!
Take control, be intentional, and have fun!