Possibly a faulty seal or door catch. Open and remove all memory cards and batteries. examining closely for any sign of water inside the camera. Cut some thin card (cereal packet type) or paper into a strip. Gently and slowly insert the card/paper into the openings and try and get to all the corners. When you remove it look for damp patches on the card/paper. If it happened recently there will still be moisture inside. If there are any signes of water use the same technique for drying moblie phone you'll fine posted elsewhere. If you manage to get it working Don't use it in water again unless you manage to find the fault and fix it.
What version of the software are you on? Apple disabled iPhone 8 with DIY screen replacements in IOS 11.3. After a public outcry they then relased a further update to enable the phones again. Use iTunes to update to the latest version and all should be well. ( https://www.express.co.uk/life-style/science-technology/944736/Apple-iPhone-screen-repair-iOS-11-3-update-iPhone-8 )