Hello Stephanierzs30 and welcome to Apple Support Communities.
It appears you are having some difficulty with the auto focus function of the rear-facing camera on your iPhone.
Just as a starting point, keep in mind that the front-facing or "selfie" camera is a fixed-focus device and the following does not apply to it.
It sounds like the issue is with the auto-focus function. This is most often (if it is not an issue of physical damage to the iPhone) caused by magnetic accessories and can include anything from some cases to lens attachments. Does the same thing happen if you have the iPhone out of any case you might use and with no accessories attached?