This is something a lot of beginner photographers struggle with, but not you.
If you have ever taken a photo of something still, like a person standing in front of you and you found the focus going in and out repeatedly. You will see that it is frustrating because you do not even know what is going on.
That is why you need to learn the focus modes, and there are three of them.
If you want to take a photo of something in front of you, you want to use One Shot. On Canon cameras, it is called One Shot, but on Nikon and most other cameras, it is called AutoFocus-Single (AF-S).
What it does is it will focus once then it will take a photo when you put the shutter down. It will not refocus until you grab your finger off the shutter. It is the way to get a sharp image of a still-life object.
TIP: Listen to the camera’s focus lens; you will notice there is no much movement in One Shot/AF-S mode.
What about when you are taking a photo of something that is moving? For that situation, you want to use Auto Focus-Continuous (AF-C) or AI Servo on a Canon camera.
What this does do? It will focus on your subject. Such as a marathon runner and as the runner moves, the camera will keep refocusing between photos. Obviously, you will want to be on a continuous moving mode.
It is the perfect mode when you are shooting something that is moving, and you want to have a clear photo every single time.
The default camera focus mode, it will choose between the two previous focus modes. If it thinks your subject is still, it will select the AF-S mode, if it thinks your subject is moving it will switch to AF-C mode, automatically.
Last but not least, there is of course so much to learn about photography, but do not quit learning and applying what you learn.