You're trying to take what is called a Macro photo, which the iPhone 15 Pro and 15 Pro Max are specifically designed to do well. But the iPhone 15 does not include the camera for Macro Photography. If closeup photography is important to your photography needs, you likely should have purchased a Pro model over the 15 model.
Now, a workaround is to take a photo further and in focus, then crop in to see it more closely after you've taken the picture. But you won't have the ability to take actual Macro Photographs on a 15 model iPhone.
Open this link to compare the current iPhone models and go down to the Camera Area, where you'll see that iPhone 15 Pro and 15 Pro Max offer Macro Photography, which the 15 does not --> iPhone - Compare Models - Apple