If it helps anyone, here is a description the rules one needs to know before visiting an onsen. Basically there are 2 kinds of onsen: indoor and outdoor (rotenburo). Most are segregated by gender although in some onsens, you can find private rotenburos which you can reserve for familes on an hourly basis i.e. it will be a small rotenburo in which maybe 4-5 people can fit.
If you have a tattoo, cover it up with bandaid. Otherwise you most likely will not be allowed in. Of course, if you have a crewcut, a missing pinkie and tattoos of dragons, mermaids and kanji characters that say "My brother is a Yamaguchi-gumi Oyabun" that cover your whole body, you're OK - you can just walk-in, nobody will say a thing. Don't even have to pay.
Like I said before, onsens/ryokans have lots of "rules" and Japan is a country, if nothing, that idealizes strict adherence to rules.
For a ryokan, you will stay in a Japanese-style room with tatami. Tatami rooms also available in hotels in onsens. The futons and the kakebutons (comforter) will stored in closets and somebody will make them/lay them out in the evening for you. The onsen will most probably be in the basement, but not always.
1) You will be provided a yukata (this is like a cotton kimono with a sash), slippers and a washcloth in your room. Wear the yukata, carry the washcloth and walk to onsen using those slippers. Don't forget to tie to sash tightly, otherwise you'd might be very popular with the ladies. Only they are 65 year old obaterians (means strong old women: this is another topic for another day)
2) Important: as onsens are usually separate for men and women, you will have to find out the right entrance. There will be a noren (like a half-curtain) over the entrances with the kanji symbols for man and woman. Sometimes the noren will be colored blue for men and red for women but not always. My advice: follow other guests' and see where they go. Or not. Since you're gaikokujin, heh heh you are allowed to make this "honest mistake" one-time only and go into the other side for a look-see. Remember your "sumimasen sumimasen".
3) As you enter the sliding doors, you take off your slippers. Make sure you know where you put them - sometimes a cubby hole is provided, sometimes a tag is provided etc. You then go barefoot into the "dry area".
You must never wear outdoor footwear on tatami. This is very bad manners.
4) An onsen is typically separated into a "dry area" - covered with tatami - and the bath area itself. The "dry area" is for you to disrobe, store your clothes in the provided lockers. There will be basins for you to shave (you do not shave in the bath area), hairdryers etc.
5) Once you disrobe, all you will have is wash cloth (not forgetting your locker key). You can use the wash cloth to preserve some modesty. Some of you might need two washcloths (don't boast). It is impolite to stare at other people's state of undress, unless they need 3 washcloths to cover up. In that case, you're allowed to ask them for an autograph and if they've worked with Maria Ozawa before.
6) Go through the sliding doors for the bath area and along the wall, you'll see showers. Grab a stool and a bucket and take a shower sitting down. You're not allowed to sing - this is not a karaoke. Lots of onsens have unique toiletries for the region (e.g. horse-oil shampoo, carbon soap etc).
7) Once done with shower, you then soak in bath. The washcloth you can leave on your head but what I usually do is I take the small basin along with me - I use it to pour some of the bath water on me first to let my body acclimatize to the heat) - I then put the washcloth inside the basin and set it right next to the bath. You cannot bring the washcloth into the water.
8) The bath will be hot around 42C - some prefer to go in slowly while hissing "yossssshhhhhhh"; others prefer to go in all at once - whatever works for you. Usually I soak inside the bath for 10-15 minutes - any more, I'd be sweating too much afterwards.
9) Reverse the above when you leave. I shower just with water after the bath and then change back into my yukata, walking back to my room with visible steam rising from my head. Don't go up those stairs too fast, you might faint due to the light-headedness from all the heat

10) If you are shy, go during the times of the day when there is lower traffic. The "high season" time is just before dinner. If you go late at night say 10-11pm, almost nobody will be there. That in fact, is my preferred time, after a soak, you go directly to bed and sleep like a baby. Another time is in the morning before breakfast, not that many people.
Finally, why do people go to onsens? They believe the mineral waters cure ailments. Different regions will have hot springs with different compositions of minerals, which in turn, cure different ailments.