Pain in the testicular region can be attributed to:
In your post you have not mentioned about any history of trauma.
So an infective or inflammatory cause can be thought of ...such as orchitis or epididymo-orchitis
Under such condition, you need to take antibiotics along with analgesics under the guidance of your Doctor.
There is nothing to worry...you will be fine.
Make sure you take the medications properly.
Also avoid wearing tight fitting underwear or trousers...so that pressure in the testicular area can be prevented.
Wishing you a Good Health. Let me know if I need to clarify further.
Thanks & take care.