Of course you want it dry before trying it and gumming up the inside with sludge. Place it somewhere with a fan directed on it and leave it there for hours, maybe a day. It will be very dry. I have dried out TVs and other such items that were in the rain and this worked for me. Start by getting every drop you can see with a paper towel/tissue.
You’ll be fine with it.
As a last resort, you might look at the directions for hints.
I once had a brain fart and took whole coffee beans on a camping trip. Yeah, I ended up grinding the beans between rocks. I was not going to be denied coffee.
As an extra precaution you might want to plug the grinder (once dry) into an outlet with a GFCI (ground fault circuit interrupter) for testing. These outlets usually have a “reset” button, and are commonly found in bathrooms. They are designed to cut power virtually instantaneously if you drop your hairdryer in the bathtub, but the same technology will save you from inadvertent coffee bean electrocution…
Today is the second day of using the grinder again with no adverse effects! Wheew! I was not prepared (financially) to have to replace that thing. Awesome!