I have a brown patch on top of my penis

Hi I have been noticing the brown patches or spots on the penis glans. I m not sexually active too.All i do is masturbation ****> I am not feeling any irritation or no discharge , but sometimes a foul smell comes from my pants after urination. Do i need to consult a doctor or is it normal.Please help me with thi

Maybe you are not taking care of penile hygiene.

Wash with a mild soap and warm water daily.

You haven’t uploaded any pic, so it’s difficult to comment on the brown patches.

In the same way that you can get a foul odour from your armpits when bacteria mixes with the sweat, the same is true after you urinate.
As Amarjeet states, the essential is to control the bacteria you get after urinating.
First you must ensure your bladder and urethra is completely emptied, otherwise you will get the leakage of a small amount of urine after you have put your penis back in your clothing.
You need to be relaxed about the process, have no tight clothing holding in urine from your abdomen and down and out through your penis itself. Take your time, ensure all remaining remnants of urine are drained - then you must fully wash your penis and completely dry it after EACH time you urinate. If you cannot wash after urinating, such as when you are out of the house, either carry a clean paper tissue or use clean toilet paper to wipe away any urine that has got onto the head and surrounding area of your penis. If you are NOT circumcised, always draw your foreskin as far down the shaft of your penis towards your body before you start to urinate.
As Amarjeet states: we need clear photos to comment on the brown patches …