Samsung Galaxy a40 camera not working it's like its freezes an cant do nothing with it
I assume your ok for internal storage @Chrisjh
If you are then first try opening settings, apps, camera, storage, clear data and cache etc and then try launching the camera again.
If no joy and a soft reboot by turning the phone off and on does not help then you may want to consider a factory reset after backing up and remove any relevant Sd card.
Current Phone >Samsung Z Fold³ 5G. Back Up Phone > Note 20 Ultra 5G SM-N9860.