When you say having trouble going to the bathroom do you mean having a BM? If so, then yes you can do a childs enema from the drug store. This is the fastest way to take care of it. He could have other issues though so your safest bet would be to take him to a vet since he has a little age on him. It could be constipation but it could also be fluid in his abdomen from heart problems, liver problems, and a number of other things.
If my answer was helpful please click the green accept button My answer should not take the place of a Vet's diagnosis when needed. Positive feedback is most welcome and a bonus-though not required-is greatly appreciated no matter how small.