There are varying opinions about the best way to clean a bike. Check these web pages:
Below, I provide my own instructions for cleaning a bicycle.
Assemble the supplies you will need:
Be sure your tires are inflated, so water does not seep in where the rims and tires touch.

Ideally you would wash your bike at a public car wash, because they have drains to carry away greasy soapy water for wastewater treatment. Neither bicycles nor cars should be washed in a driveway or street; the runoff goes down the gutter, into a storm drain, and eventually empties into a natural body of water.
If you don't drain your runoff, I hope you at least use cleaners that biodegrade rapidly.
For easier access and more thorough cleaning, you can remove the wheels, but it's not necessary.
You should either empty or remove any carrying bags you have attached to your bike. Remove any frame pump and accessories that could be harmed by water.

If you clean and rustproof your bike, as described in this page, you hopefully won't have much rust to remove.
If you do find frame rust, scrape it off; I prefer to use a metal file for spots on the frame. For cables and spokes, I scrub with sandpaper or steel wool.
WD-40 and other rust inhibiting products help with red rust in areas where it's too much trouble to scrape off.
Because dirty water will flow downward, prop the bike upright and pour soapy water on it from top to bottom. If you spray water, that might force grit into various bearings. It's better to let it dribble down onto the bike. Avoid greasy moving parts, which require degreaser instead.

To catch greasy bits as you remove them from the bike, put newspaper pages underneath your bike. This is needed only if you are concerned about leaving stains or bits of greasy solids on the pavement.

If you see caked-on dirt or grease, you can remove it with a toothpick or screwdriver.

Spray degreaser on the chain, chain rings, and derailleurs only. If the degreaser's label does not say how long to let it remain on the sprayed parts, try ten minutes.



Shown below is a cog brush, sold at bike shops. It's good for scrubbing all of those areas you sprayed with degreaser.

If you want to be thorough, remove the chain and clean it as described in the web pages I linked to above.
Otherwise, wet your brush, and rub the upper length of the chain. Move the pedal opposite of the pedaling direction to advance the chain, so you can brush all of it. To clean the inside areas of the chain, force the bristles through, as demonstrated below.

An alternative is to use a chain cleaning machine like the one you see below. It's a handheld device that scrubs the chain from multiple angles as you make the chain travel through it.

After cleaning the chain, it might still have some caked on grease. You can remove that with a paper towel.

Scrub the chain rings and cogs with your brush. To fully access all of them, shift gears whenever you need to move the chain (if you didn't remove the chain).

You can also slip a paper towel into various crevices, to help remove grime.

Your brushes may collect oily substances on the bristles. Periodically wipe the brushes with a paper towel.

Put the sponge in your bucket of soapy water. Sponge the frame, handlebar, frame, and brakes (especially their undersides).

Wet-brush the tires, rims, hubs, and dropouts.
Sponge the bike with clean water.
Wipe down the bike with clean dry paper towels, to pick up clinging dirt and oil. Don't just let it air dry.

Get all the crevices.
Slip a rag between each brake pad and the rim, and rub it back and forth against the pad.

If you removed the wheels, put them back on.
You can just apply whatever machine lubricant you have handy, such as motor oil or a spray-on product. I don't think it matters very much, but beware that WD-40 is not suitable for your bicycle.
If you have no lubricant, or want to use the best possible lubricant, you can compare brands. Go to BikeForums search page and search for something like "best chain lube". You will see plenty of opinions.
I prefer any bike-specific non-greasy lube, such as White Lightning. It's a liquid that you squeeze or drip out of the container. I flip my bicycle upside-down, and drizzle the stuff on points where parts rub against each other. For my chain, I apply the lube at points where the chain touches the various rotating parts, as I turn the pedals. That way, each rotating part gets lubed at the same time as the chain, and less lube drips onto the ground. The lube rapidly solidifies into a waxy substance.
Unless you use a non-sticky dry lube, those parts will attract dirt, which will grind and wear against the metal, sort of like sandpaper. This is why I now prefer dry lube. If you use something sticky, you can at least minimize this problem by wiping the chain with a paper towel or lint-free rag, to remove excess liquid lube.
I previously used a greasy spray-on lubricant, and the following instructions depict how to do that.
Lube points where cables slide against a surface. You could also spray lube onto a paper towel and rub all of the exposed cables, to coat the cables and prevent rust.

Lubricate the chain by applying lube to a pulley while hand-pedaling backwards.

If the lube is sticky, it will attract dirt. Also, lube does not help on the outside of the chain links. So, if your lube is sticky, wipe off the excess with a paper towel.

Lube the pedals' bearings.

For both front and rear wheels, there is a bearing on each side, where the axle passes through the hub.

The photo below isn't clear, but that is a stream of lubricant sprayed at the front derailleur.

Hit the teeth of the chain rings.

Below, the stream is spraying into the space just right of the smallest cog. That would have been easier if I had the wheel off.

I'm squirting through the spokes and hitting the rear derailleur's inside areas.

There is a bearing, where each crank meets the frame, that should be lubed.

Apply car wax to the painted parts, once they have fully dried.