There are many ways, this is my method.
Get some citrus based degreaser and an old water bottle.
Remove chain and put in old bottle (get a quick link if you dont have one already).
Add an oz. or two of degreaser, cap and shake. Let sit for a while (couple minutes)... Dump out nasty black colored degreaser. fill bottle 1/2 way with hot water, shake like mad, dump the water that now looks like nestle quick, or nesquick for you young whippersnappers..
Back to 1 oz. degreaser, shake....
Repeat until degreaser and water run clear.
Chain is now crazy clean. Dry completely and lube.
Ride bike.
I have found no other way that compares with the result you get from this method.