Please try the following:
1. Try to take more pictures to see if they can be saved.
2. Check if your phone's storage space is sufficient. If needed, free up space to store photos.
3. Go to Settings> Apps> See all Apps> Find Camera> Storage & Cache> Clear Storage and Clear Cache. Then then try to take a photo.
4. Back up any important data and restore your phone to factory settings or update to the latest system.