I have nail infection. There is a swelling sack on the top of the toe of my foot and it hurts so much I can't even wear my socks. What should I do?

Drain. The infection needs to be drained. See a primary doctor. .
Remove nail. Sounds like the nail, all or a portion, has to be removed. Antibiotics alone won't work. See a podiatrist. Sincerely, Dr. Latva.