Externalities are something those that do not understand economics bring up. Literally every action or inaction a person does every second of every day creates externalities. For instance, my decision to take a nap instead of watching a show on Hulu creates an externality in that Hulu and its partners make less advertising revenue.
Due to the billions upon trillion upon upon upon near infinite decisions made every day by every living thing in the entire world, economics is insanely complex on its surface. It is chaos.
This is where spontaneous order comes in. These near infinite decisions and actions every day create, essentially, ordered chaos. As an example found in nature, thousands upon thousands of bats can fly out of a cave all at once and none of them bash into each other.
This is the best approach to economics. It is free market capitalism with few regulations. Regulations that simply assure various assurances necessary for capitalism to work. Liberty laws. Essentially, legal moral codes. If violated, person is punished. Property laws, laws against assault and murder and everything bodily harming inbetween, and such.
It is not the government's role to "prevent" things. It is there to respond to violations in the basic liberty laws. The market can take care of everything else better than the government ever will.
The curious task of economics is to demonstrate to men how little they really know about what they imagine they can design.