The camera will not take a picture in P, S, or A if the camera is in Auto Focus mode - and is unable to focus. Make sure that the Auto / Manual focus switch on the camera body AND the lens are BOTH in an Auto Focus mode. A tip off would be that you do not hear the lens focus motor running while trying to find focus.
If you do hear the focus motor, you may not have sufficient light on the subject for the camera to find a contrast "edge". In this case, the focus motor will hunt from where ever it is all the way in one direction, and then all the way in the other - trying to find focus. You'll need to provide more light or if you have the focus assist lamp (on the front of the camera) enabled - make sure your fingers are not blocking it while 1/2 pressing the shutter.
You can take pictures "all day long" in Manual Focus mode regardless of whether the subject is in focus or not. The lower left corner has a green circle or disc that indicates proper focus. Otherwise, a green triangle shape will be visible close by.
More info on Focus is available here
. I hope this helps and good luck! Please rate my reply. Thanks.