The dog usually express their anal glands on their own, each time they poop. Sometimes, depending on the dogs diet and other factors, the glands become impacted and must be 'manually' expressed.
Believe me, it's NOT fun. One of our dogs had to have surgery to repair a ruptured anal gland and what was coming out was NASTY

Ruptured right next to her anus and to be honest, it was the consistency of cold molasses...really dark brown and sticky gross. Of course, me being the 'brave one' puts on the rubber gloves (hubby is an EMT, there's always gloves around the house) and 'checks it out' and wipes it up a bit for her, but it was clearly not something we cold solve at home.
Off to the vet...$400 in surgery and boarding costs later, she came home with one of those god awful lampshade collars to keep her away from her butt :), her butt was shaved, red, irritated and stitched back together...yuck!
Now, once a month, *I* am the lucky one that listened to the darn vet and learned how to express those darn things :D so I get to do it. She's not even my dog for crying out loud...she belongs to my brother in law - he says "I'm not doing that - how nasty!" FYI - he's an EMT as well - I'm CERTAIN he's seen worse

:p
So, in closing :) take her to the vet - MUCH easier to have him 'clean 'em out' than have it rupture and be oozing all over the rugs, furniture, YOU, and have the dog need surgery. Painted a pretty picture, didn't I? :D
Let us know how the trip to the vet goes. :D