How to Use Autofocus Lock on Your Nikon D5300
When you set your Nikon D5300’s Focus mode to AF-C (continuous-servo autofocus), focusing is continually adjusted while you hold the shutter button halfway, so the focusing distance may change if the subject moves out of the active autofocus point or you reframe the shot before you take the picture.
The same is true if you use AF-A mode (auto-servo autofocus) and the camera senses movement in front of the lens, in which case it operates the same as just described. Either way, the upshot is that you can’t control the exact focusing distance the camera ultimately uses.
Should you want to lock focus at a specific distance, you have the following options:
Change the Focus mode to AF-S (single-servo autofocus). In this mode, focus is locked when you press and hold the shutter button halfway.
Lock focus with the AE-L/AF-L button. First, set focus by pressing the shutter button halfway. When the focus is established at the distance you want, press and hold the AE-L/AF-L button. Focus remains set as long as you hold down the button.
Keep in mind, though, that by default, pressing the AE-L/AF-L button also locks autoexposure. You can change this behavior, however, setting the button to lock just one or the other.