Cartridge bearings consist of an inner bearing race, ball bearings (often in their own retainer), an outer race, and seals of some sort.
Today I overhauled the bearings in my XO rear derailleur pulleys. It should be pretty obvious by the photos why it needed to be done. Benefits are much longer bearing life which leads to less rotating resistance and catastrophic failure.
To properly service a cartridge bearing you need to be able to access both rubber seals. If you can't and it is turning rough (or not turning at all) then chances are you just have to replace it since pressing out a bearing usually damages it in some capacity. I may cover cartridge bearing removal and installation in a later post.
So first things first, I removed the derailleur from my bike and removed the pulley wheels from my derailleur.
Step 1: Isolate the bearing you are going to be working on.

Step 2: Remove any dust shrouds or bushings that might be in the way. You can now see the cartridge bearing complete with rubber seal. The rubber seal has a number on it which can be used at a bearing shop or bicycle shop if a new bearing is needed.

Step 3: Remove the rubber dust shields (both sides will have one in some capacity). I use a pin and gently pry under the seal and lift the cover off. Be careful not to do any damage to the seal. Most seals have a brass or metal core that can be easily bent.

Step 4: Inspect the bearing. This is a really good, really dirty example. To think I also did this in June, didn't take long for the dirt to find its way back in. I also clean the rubber/brass dust shields with a rag being careful not to bend them.

Step 5: Flush the bearing out with degreaser. I use Finish Line Speed Degreaser because it blasts out under pressure and doesn't need to be rinsed. You can also use a chain citrus degreaser but be sure to rinse it well. I also blast out the bearing with an air compressor nozzle to ensure thorough dirt/old grease removal.

After cleaning.

Step 6: Pack the bearing with grease. Run a liberal bead all along the ball bearings. Having a grease gun really helps to make this clean and easy. Not rocket science to do it without one just a little bit messier. Make sure you use a good quality bearing grease. Pack both sides equally.

After packing.

Step 7: Spin the bearing in your fingers to work the grease into the balls. If there are any grease voids opened up by this then squirt a little more in to ensure full coverage. Push the dust seals back into place (brass side in) and wipe off excess grease.

You're done! Just that easy. Cartridge bearings can be slightly high maintenance. It's not hard for them to become contaminated. Check areas like your headset, pulleys, and bottom bracket regularly by turning them with your fingers and feeling for roughness. Sometimes even after cleaning they will be rough. If the race or balls are scratched then there is nothing you can do other than replace them.