I almost hit my friends
How would your friends have reacted if you had hit them?
It would have made them upset.
You shouldn't hit your friends. It is good that you didn't because it could really hurt your relationship.
After that statement I can only agree with you.
I'm glad that we're in agreement, and that you hopefully won't do such a thing in the future.  I don't know if you meant that you almost hit them accidentally with your car, or if you almost deliberately hit them, but either way, the consequences of such a thing are much worse than whatever made you distracted or angry in the first place.  It is good to be more careful and/or considerate.