is face-recognition on? if so, a face may need to be present.

what's your exposure priority? average vs center-weighted may affect it.

is the scene somewhat dark? do you have af assist light on? what's the flash setting (slow synchro, red eye, auto)?

area vs center vs multi focus?

all those could come into play and cause the camera to focus on something other than what you want. i suggest you explore your setting and try to some test shots to see how the various settings affect the focus. if all else fails, set the camera to P/auto and see if the problem still exists... if so, consider sending it in for repair.