Safety first! The first thing to do in the case of an accident is to check that all parties are okay. If anyone is injured or in danger, call the emergency number and make sure help is on the way.
Then, exchange thorough contact information (full name as in their ID, email, phone number, address) with other parties and possible witnesses involved.
Take photos of possible damage to any vehicles or property. Later, and hopefully as soon as you’re able, you should file a claim to get insurance coverage.