Before you do anything, make sure you take the time to restart your phone, which will most times fix the camera. If you have no success, try clearing the cache and data of the camera by going through the applications, force stop the camera, going into the storage section, and clearing the cache.
Sometimes there are third-party applications that can interfere with the workings of the camera, so stopping them is something good to try. If there are still problems, you may have to clean the cache and data of the whole phone. To do this, set your phone to recovery mode and wipe the data and cache, and if all attempts fail, you might have to complete a factory reset. Complete instructions for all of these procedures are on the internet and easy to follow.