Try knocking the phone from side or behind while the camera is on and you will notice the focus works again.I and many people facing smililar issue from few months. And many update came non of them resolved the issue so far
This is a common issue is S21U a little search online and you will find many people complaining of the same issue.. Unfortunately it's a hardware issue it seems. Ofcourse samsung playing blind and cheated there premium customers.