After a car accident, your first priority should be seeking emergency medical attention if you or any passengers need it. There are other priorities too, of course, such as contacting the police and ensuring your safety (for example, you could move your car if the accident was minor, or set up road flares).
Another important thing is to preserve evidence carefully. Doing this could be the difference between you getting the compensation you are entitled to versus an amount little more than peanuts.
Often, the police go to the scene of an accident, so be sure to get a copy of the police report. The responding officer can explain how to do that. If the police do not show up, you should go to the police station and file a report.
The police report could be the first of what is a long string of documents. If information in it is wrong, it needs correcting as soon as possible. Assuming everything is correct, having a copy of the report helps streamline your insurance claim and helps your attorney, if you have one, decide on an approach for the case.
You can never take too many photos of a car accident you were involved in. Shoot from different angles and capture the damage to the car(s). Photograph any injuries to yourself, and look for evidence that could be important. For example, is a stop sign missing? That could have contributed to the accident, so photograph the lack of it.
Even if the police show up and interview witnesses, it is often a good idea to get witness information on your own (your attorney or someone from his or her office can do this, too, as long as you call quickly). Ask witnesses for their names, how to contact them and their perception of the accident. If possible, get their exact locations at the time of the accident and any potential complications such as intoxication or leaving eyeglasses at home that could affect their accounts.
An attorney will probably tell you that another way to preserve evidence is to get medically checked out, even if you think your injuries are minor. This helps set a medical history that could prove valuable in court later on. Preserve records of each medical visit/encounter.