A picture would have been very helpful but anyway the infection can be due to many reasons like cavity, food accumulation, gum problems, erupting last tooth etc.
So I will give you few general solutions.
Lukewarm salt water rinse thrice daily and medicated mouthwash rinse twice daily.
Next Steps
If problem continues consult online or visit dentist
Health Tips
Make sure there is no food stuck between teeth. You can use dental floss to take it out.