Chosen Solution

the camera was opened under water, what should I do? was opened in the battery compartment

The rice idea is a good one. But, one thing is that salt is very corrosive. So before u submerge in rice, you should open the camera and clean the inside with fresh water then alcohol. (90% Isopropyl). After you do this, then do the rice technique. Leaving the salt in there is going to corrode the camera.

Now was this opened in salt water or pool? And does it still work? Try to shake the water out. Then leave it fully submerged in a bag of white rice for anywhere from 24 hours to a couple weeks with the battery cover open (rice absorbs the moisture). The longer you leave the camera in the rice the better, but two weeks is sometimes unnecessary depending on the damage.

Drop camera in deionized/distilled water without battery. This will hopefully clean the camera insides including the lens element that has fogged. Remove camera, drain for 1 day over paper towel rotating every once in a while to dislodge puddled water. place in oven at 150F for 30 minutes on hotpad so it doesnt get full heat of metal contact. Next, place camera in bag of rice or other desiccant for a week, ou cna put in fridge too as that air is very dry. After you take out of fridge, warm to room temp for a few hours and then you are ready to cross fingers and put battery in. If all goes well, your camera will come back to life. The lens may still be dirty but that is a physical cleaning operation.