It may be due to heat or due to trauma or hit. Whatever cause may be but there is inflammation or swelling in the testes . You should start an analgesic and anti inflammatory drug along with antacids and one suitable antibiotic after the advice of your doctor.
Next Steps
It will be subside after taking above medical remedies. You should visit the clinic for proper examination.
Health Tips
You can call a physician for home visit , If you want to avoid to go outside because of current pandemic.