If possible, move your vehicle out of traffic and turn on its flashers. Put out warning triangles or flares if you have them. Then stand a safe distance away while you talk to other drivers or wait for help.
Double-check yourself and your passengers to make sure no one is hurt. Even a fender bender might have caused an injury that's not noticeable right away. Summon medical help if there is any doubt.
Call the police, especially if there has been substantial damage or anyone is injured or acting confrontational. Ask for the investigating officer's name and contact information, and for the accident report number so that you can follow up.
Obtain the name, address, phone number, drivers license number, plate number, and insurance information of any other drivers involved in the accident, along with the names of anyone with injuries and any witnesses. But don't argue over who is at fault or admit blame.
If possible, take photos of the scene (a cell-phone camera can come in handy) or draw a diagram showing the cars' positions. Contact your insurer right away.