You need to go see your doctor
right away for help. Symptoms like pain and discharge from the penis are always concerning and need to be evaluated. I recommend going to see your primary care doctor immediately.
The most likely cause of your symptoms is a sexually transmitted infection, such as gonorrhea or chlamydia. In most otherwise healthy men, these are by far the most common causes of the symptoms that you are experiencing. Your doctor will be able to test for these infections with simple urine tests and, based on the results, they will be able to give you prescriptions for antibiotics to treat them if they are present.
They can also evaluate you for other potential, less common, causes of your symptoms, such as a urine infection or an inflammation in the prostate.
While waiting to see your doctor, it is important to avoid sexual intercourse, as if this does turn out to be a sexually transmitted infection, then it is highly contagious and you could easily pass it on to any sexual partner.
Contact your primary care doctor's office right away to make an appointment to be seen. I hope that you are feeling better very soon!