Testicular pain can be due to injury, infection (Epididymitis or Orchitis) or inflammation, testicular torsion -- most common in young men between 10 and 20 years old, excessive bicycle riding, hernia or kidney or ureteric stones.
You can provide support to the scrotum by wearing an athletic supporter, apply ice to the scrotum, take warm baths if there are signs of inflammation, while lying down, place a rolled towel under your scrotum or try over-the-counter pain relievers, like acetaminophen or ibuprofen.
The final diagnosis can only be made after a thorough physical examination including examination of the abdomen, scrotum, testicles and rectum.
Lab investigations like complete blood examination, urine examination, ultrasound lower abdomen and sometimes a urethral swab will help in diagnosis. Treatment will be started thereafter.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.