Hello, I'm Dr. Deb and will do my best to help you today.
I'm sorry that your cat appears to be constipated.
While you can certainly give him an enema as one option to help relieve his problem, I wouldn't use mineral oil. Instead, I'd use either warm water or an otc pediatric suppository which contains glycerin ONLY. You'll just want to double check the label if you do to insure that it doesn't contain phosphate since these can be toxic to cats.
If you elect the warm water enema option, then lubricate the end of a syringe or a small turkey baster with Vaseline or K/Y and gently insert it into his anal opening about 1 inch or so. Then gently squeeze the water into him. It may take several trys before the stool is loosened, though.
There are oral options such as human Miralax but they aren't likely to be effective if he's badly constipated.
I did want to point out that sometimes it's difficult to tell the difference between trying to urinate versus trying to defecate. If there's any question in your mind that he's actually trying to do the former and no urine is being produced AND his abdomen is sensitive, then this would be considered an ER type of situation.
I hope this helps. Deb