If you do accidentally get your guitar wet, it is important to dry it off immediately. You can use a soft cloth to wipe away any excess water, and then let the guitar air dry in a warm, dry place. If the guitar is still damp after a few hours, you can use a hairdryer on the lowest setting to help dry it out.
It is also important to remember that guitars are not waterproof, so it is best to avoid taking them outside in bad weather. If you are planning on playing outdoors, it is a good idea to bring a guitar case or cover to protect your instrument from the elements.