I just had to do this. : )
This is from my 10/22 post that sent you into the yard to eat worms:
"Some rules. Cotter pins are installed with the threads in opposite directions. Cotter pins must have perfectly smooth flats, if you can't clean them up with a file, get new ones. Most bicycle shops should have them. With the left side pedal pointed forward, the right side cotter pin should have the thread pointed down, the left side, thread up."
This is a little more specific because it puts the heavyest loads on the widest part of the cotter pin. I also like to re-tighten the cotter pins after they have had a few minutes to seat or after the first ride.