The toe next to my big to is red swollen and painful to touch? How can I tell infection from a jammed toe?

INFECTION SIGNS. Jamming your toe frequently impacts the nail into the skin. Pain (but, a broken toe will be painful too), redness, and drainage are seen with an infection. You should see a podiatrist to determine if an infection is present, maybe an x-ray to check for a break. Sincerely, Dr. Latva.
Red toe. Redness and swelling and pain can be from both. Is it draining? Is it getting better with time or worse? Did you jam it and then after a day or two it got red and swollen? If it's draining or getting worse rather than better or there was a bit of a delay before getting red and sore then concern for infection is higher. You should find an Orthopaedic foot and ankle surgeon near you. .
Or from gout. Go see a doctor. You cannot tell without exam and testing, and if you guess wrong the consequences could be severe.