@MickyO: I'm sorry to hear that you're experiencing this issue. Is there a sufficient amount of light in the scene that you're trying to focus on? Can you try cleaning the camera lens with a soft, dry microfibre cloth to see if this helps at all?
Have you fitted a case on the phone that could be hindering the camera ?
Also some people were fitting camera module glass screen protectors onto the phone to help protect from scratches and damage etc. Have you fitted one ?
And or has any in-transit plastic protector been removed.
There are diagnostic tools in the phone via your Samsung Members App under GetHelp and then diagnostic and or via launching the phone app and dialing in *#0*#
Sometimes clearing the cache and data in Settings, Apps, Camera, Storage can help too.
Current Phone > Samsung Z Fold³ 5G.