How I fixed slow boot on Mac

I finally figured out why my Mac took 10 minutes to start up.