Generally the doctor uses a gel to slide his finger in. It is likely that you have swelling there -- that is the common sign of infection and the common reason for an examination at your age. I hope that it is something easy to fix. Don't sweat it. It will be fine.
The only problem at your age with your prostate would be prostatitis, an infection, but that would be very rare at your age. If you were older and had a prostate exam then a doctor would wear a glove and get some gel and slide his finger inside your anus (bottom) and feel if your prostate was enlarged.
If they have said there is something wrong with your butt are you constipated? Do you strain to go to the toilet and does it itch afterwards?
They may look at your butt for that, but very very unlikely prostate at your age.
Regards
to ceck your prostate they stick their fingers deep in the rectem and feel around for anything suspisios if they feel anything abnormal they will give you a colononoscopy where they insert a camera into your rectem and take pictures and look around