Depending on your camera model and mode, you may have different ways to activate exposure and focus lock. For example, on some cameras, you can use the AE-L/AF-L button to lock both exposure and focus at the same time, while on others, you can use the AEL button to lock only exposure and the AFL button to lock only focus. On some cameras, you can also assign these functions to other buttons or dials. You can also use the half-press method, which means pressing the shutter button halfway down to lock exposure and focus, and then recomposing the shot before pressing it fully.
The exposure and focus lock features work differently on different camera modes. On manual mode, you can set the exposure and focus manually, and they will not change unless you adjust them. On aperture priority mode, you can set the aperture manually, and the camera will adjust the shutter speed automatically, but you can lock the exposure if you want to keep it constant. On shutter priority mode, you can set the shutter speed manually, and the camera will adjust the aperture automatically, but you can lock the exposure if you want to keep it constant. On program mode, the camera will set both the aperture and the shutter speed automatically, but you can lock the exposure if you want to keep it constant. On auto mode, the camera will set everything automatically, but you can still use exposure and focus lock if you want to override the camera's decisions.