Assuming you used your 18-55mm lens for this one, the closest you can focus is about 10". If your subject is any closer than that you'll never be able to get it in focus.
When you're very close to the subject like this, your effective depth of field is going to be very shallow. In fact, it might not be possible to get all of your flower in sharp focus to begin with. So this is the kind of shot that would definitely benefit from focus stacking, which unfortunately is not a capability your particular camera has built in. You can do it manually, but either way you will definitely want to use a tripod to keep it still between each exposure.
My R10 has this capability built in but it's finicky, so I avoid it. I do use its inbuilt focus bracketing feature, however, and do the stacking myself externally. I use Helicon Focus for this but it's not free; those who are cheap and/or averse to pirating it may want to check out Petteri Aimonen's focus-stack utility instead.
Or as counterintuitive as it sounds, you could back up away from your subject and use the zoom on your lens to zoom in. Being further away will also increase your effective depth of field.