What would cause a red swollen infection on the side of the big toe? It now has yellow spots on the nail bed. I didn't injure it, I do wear flipflops.

Ingrown toenail. It sounds like you have an infected ingrown toenail.
Could be paronychia. What you describe could be an infection around the nail(paronychia). The yellow spots could be pus. See your doctor or podiatrist. You may require antibiotics. If you have an ingrown toenail, you may require a small office procedure. On the other hand, a red painful swollen big toe could be gout. Difficult to tell the cause without seeing in person what you describe.