Enemas were previously used in a non-S&M context as a last resort cure for constipation and sometimes for administering a liquid suppository cure.
I recommend enemas before some butt play activities - e.g. prostate milking, strap-on anal sex, butt-plugging. The idea is to empty the bowels as much as possible of solid fecal matter for obvious reasons. I find enemas too messy and smelly to be done as part of a session. I like to do them beforehand, (pardon the pun) so my Mistress does not have to witness it. In most butt-play activites, the Mistress is operating the butt-toy or gloved hand, and if the slave can do anything to save his Mistress from the unpleasantness of seeing the butt-toy or gloved hand dirty he should do so. Seeing a toy come out looking clean makes enemas so very worthwhile. You should still wash all butt-toys with antibacterial soap though - especially if they are going to come in contact with the mouth or vagina.
The water temperature should be from 50 degrees C to 55 degrees C. To hot would obviously demaging, but warm enough, as warm water helps dissolve.
I have had success using a windscreen washer pump and resevoir from a car to do an enema. I left everything on the car, but simply unplugged the small tube going to the windscreen washer jets. I washed it all out with hot soapy water first. Then filled it up again, and shoved the tube up my butt. I stood beside the car, and reached inside and pressed the squirter button. Feeling the warm water being injected up your butt gives you a bit of a rush. After you pump in about half a litre you may feel like you can't take any more. Wait a bit, you may feel and/or hear a gurgling noise from you bowels. Try injecting a bit more. Wait and try again, then wait etc. When you feel you have had enough, go to the toilet. Water and other will gush out at first. Wait longer on the toilet, more will gush out in bursts. When I first did this, I was quite worried the bursts would never stop, but it did after a few minutes. You may stand up, and think you are finished, but you may need to sit on the toilet again. Be patient. When you are near finished, you may want to lean back on the toilet, and lift your legs up in the air. This opens you up a bit, and helps get the last of it out. When your bowels are nearly totally empty, what comes out may smell worse than normal toilet visits, this is ok.
Repeat if you want. Have a shower afterward. Check you haven't left any mess anywhere. Check on the bottom of the toilet seat, and clean if necessary. Clean the part to the toilet, the seat touches - if may have been splashed. Spray airfreshner, light a match to help with the smell. Leave no trace, especially if you live with your Mistress. I shouldn't need to explain why you need to keep your Mistress happy!
Your first enema will probably be quite exciting, but a bit scary and overwhelming. But don't worry, and keep persisting (if you want to). Remember: RELAX.: This is supposed to be fun!
For a full description on the topic, from what seems to be a non S&M point of view see: http://www.moondragon.org/lab/enemahowto.html