there are a number of possible causes:
electro mechanical fault with camera;
electro, mechanical, optical fault with the lens;
individual technique, such as -
set to manual instead of autofocus;
need more practice hand holding;
allow camera time to autofocus;
focusing on wrong part of subject;
too slow shutter speed;
A Canon prime lens is obviously compatable with canon body, and you say that some of the shots were ok. Also you don't mention sharpness problems with your other lens/es. So it looks unlikely there are faults with the camera body or lens.
Which brings us to technique. You mention the lens is set correctly to AF (AutoFocus). So consider the other possibilities:
Good hand holding is a technique that needs to be practiced - keeping yourself stable, holding the camera firmly against the cheek with the other hand under the lens (not over the top), elbows tucked in so you and the camera become a stable 'platform'. squeezing the shutter (sort off rolling the finger onto the button, not pressing or stabbing downwards) - at the same time as watching composition, peoples expressions etc is an aquired skill. I practiced for ages when I first got a full frame body (in the front room at home) before I could be fairly sure my hand holding wasn't the problem.
Allow the camera to autofocus - the canon and I expect almost all others has a 2 stage shutter, about 1/2 way to focus, then all the way to shoot. The default option on my Canon is to beep when focus is achieved, and another option allows focus points to light up in red when focus is achieved.
The default for Canons is all focus points active. If something is in the foreground and focuses easily, the face that you wanted may be out of focus. Explore using a single focus point (I mostly use the centre point) and then check the images to see the area you defintely focused on is sharp - where you saw the focus point light up.
Fianally the old rule of thumb that for hand held, non-stabilised lenses the shutter speed should be at least the inverse of the focal length of the camera still holds true - for 50mm lens that means at most 1/50sec exposure and if you are learning your hand-held technique aim for 1/100. So now you need to check your aperture/ shutter speed/ ISO etc - or let the camera take care of a lot of it for you. You don't say if you are using P, Av or Tv. But as a starting point try P (program mode) and make sure ISO is set to auto. P will typically give you a reasonable aperture + shutter speed for a sharp picture. Rotating the front dial will change exposure and speed in sympathy (aiming for 1/100s with your 50mm lens) , then the auto iso will automatically change to keep a reasonable value. As your experience grows you will then explore Av and Tv depending on what you are looking for in the final image.
.... or not as the case may be
If you are happy using the Scene modes of your camera and don't want to, or see no need to explore the varied settings and options that any modern DSLR offers then just concentrate on picking a suitable scene mode, develop good hand held technique, make sure you are focusing on the subject matter of interest with the focus points, allow the camera time to focus, and most of your shots will be 'keepers' - until you start to get picky with composition, but thats a whole new ball game