My iPhone XS is water resistant. I just got some burrito juice on it so I went ahead and washed it with soap and water.
It's never felt cleaner, and it feels brand new.
Is this safe?
No, water isn’t safe for any electronics. Neither are cleaning products, including soap.
Avoid moisture and clean as lightly and dryly as possible is best for the hardware - especially hardware that’s been used and bumped and dropped. Small cracks will grab water and soap, a surfactant, causes capillary action to be amplified.
Even a new phone or waterproof one shouldn’t just be washed with excess water for no good reason. It really depends on the contaminant and ability to clean without a lot of water in the end. It also doesn’t mean a drop in a pool or sink will cause a phone to fail, especially the newer ones.
Now, when choosing between your health and the phone health, most people will occasionally use something other than water, but only knowing it damages the device in excess or in concentration based on the cleaning product you choose.