Please note below is a generalised order - the onsen you go to may differ - where possible you should follow any signage available and/or ask a staff member if you have questions.
First after arriving at an onsen, you will normally take your shoes off before entering and put them in a locker - sometimes these are paid lockers (often 10 or 100 yen) that may or may not refund the usage fee. Shoe locker keys are also sometimes exchanged for a changing room locker key.
You'll then pay your admission fee and for anything else you might need (for example shampoo, body soap, towel rental). Payment may be made by way of an honesty box, a ticket vending machine (where the admission fee is normally top left with the word for adult - 大人), or to paying a person at a reception desk.
Afterwards you'll enter the changing room for your gender. Women's curtains are normally red with kanji for woman (女) and men's curtains are usually blue with the kanji for man (男). If in doubt, ask.
You'll get undressed, putting your belongings into the locker (which may be an actual locker or a cubby-hole with or without a basket). Any toiletries that you are intending to use you should take with you.
You'll enter the bathing area (which may or may not be separate from the onsen area) and find a bathing station - which will normally involve a shower head and stool - and wash thoroughly. Afterwards before entering the onsen if you have shoulder length hair you should tie it up (it should not enter the onsen water). If you don't want to wash your hair or are worried about getting it wet you can a shower cap.
You'll then enter the onsen. Depending on where you are there may be multiple pools (potentially at different temperatures), waterfalls, sauna rooms and more. So relax and enjoy. If you begin to feel light-headed or overheated please leave the onsen to rest (some onsen will have seating areas outside the onsen for this purpose).
When you're done you'll leave the onsen - at this point some people like to wash themselves again before returning to the locker rooms and changing.
Afterwards many onsen will sell milk drinks which are sometimes flavoured. Some onsen will sell other drinks including beer that you can partake in and some may even have a restaurant or food available on site.
Depending on the onsen you go to, there may also be a post onsen relaxation room, which is often a tatami room that has a TV, and sometimes even massage chairs.