When a guinea pig gets older, they are like other senior citizens in that some of their muscles loose their tone. One of these sets of muscles is the anal area. When older, many male guinea pigs (boars) no longer have the ability to push out their poop. This can also happen to boars in the prime of their lives. This is called impaction. You will need to help them along.
Checking your guinea pig, if you notice a strong poop smell and see that the bottom is swollen, you need to inspect closer.
Pick up your guinea pig and turn him over belly-side up to see the rump.
If the anal sacs are swollen like in the picture, or another picture you may have in a guinea pig care book, than you need to get that poop out.
Put the guinea pig back down and gather together all of the things you need. Many people clean their impacted boars in the bathroom. Only then get the guinea pig and go to the area you are going to perform the cleaning.
Sit on the floor. Lay down an old towel or paper towel in your lap. Place the guinea pig on your lap. Some guinea pigs will lay back on your lap and helpfully present their behinds. Some will struggle. You may have to hold the guinea pig close to your chest and bend over to get to the anal sac. If the guinea pig is really wild, wait until you can get a helper to hold your guinea pig while you clean.
Massage the swollen sack with the warm water-soaked cotton bud. This helps loosen the ball of poop. Often, it will fall out by itself. Or, you could help by very gently squeezing on the outside of the anal sac. If your guinea pig wants to eat any of the poop, let him. Some of that "poop" is actually like cud for a cow and helps him digest certain vitamins.
When it looks like all of the poop has fallen out, gently wash your guinea pig's rump with the sryinge of lukewarm water.
Gently towel dry your guinea pig and put back in living quarters with a special treat.
Repeat when necessary. Some boars will need their anal sacs cleaned every day.
This gets much easier to do with practice. Although mostly only bars get this, this very occasionally happens to sows. The ball of poop might have a really strong smell. This is normal. You could save a special treat that you only give at anal sac cleaning time to help make your guinea pig look forward to the process more.
Don't dig into the sack with your fingers and try to pull the poop out. This hurts your guinea pig. If, after reading this, you are still not sure what to do, please take your guinea pig to the vet to be shown what to do.