The camera app you are using needs to have that option, and you need to turn on that option.
You need to give the camera app permission to use the phone's location system.
You need to have the phone's location system turned on.
If you do all of that, the EXIF data in the image file will contain some type of location info.