When you go to a public bath (Onsen) you need to take a bathtowel, a small 'modesty towel' and a body that needs a wash. People with large tattoos should refrain from using the public baths (small discreet tatoos are no problem).
Pay your money at the counter and head into the changing rooms. Look for the kanji 男 for men and 女 for women. Put your valuables in a locker and undress. Put your clothes in a basket provided.
Go into the bathroom, take only your modesty towel. The first thing you need to do is take a shower if there are showers or pour water from the bath over your body to rinse off any dirt and sweat if there are not. The golden rule is to keep the bathwater clean, so rinse off any soap before you get in the bath.
You might find the bath hot. If it is unbearably hot try to get used to it by degrees. There is usually a cold water tap so that you can add cold water, but remember that Japanese people like it hot and some people might not appreciate you adding cold water, so check first. If everyone else seems to be enjoying the bath then don't add water.
The small modesty towel is often used as a washcloth, so don't put it in the bathwater. Also remember that the onsen is a place to relax, so don't do things that might disturb other bathers.
Relax, enjoy the bath. When you are ready to get out wipe your body with your modesty towel so as not to drip water on the dressing room floor.
Gentlemen, don't be alarmed if the cleaning lady comes in whilst you are getting dressed, she has seen it all before and is not interested in you.