simplest form is to pull the top hat thingy off (carefully, they can crack)
Then peel the seals out (use something small and sharp to avoid damage)
Flush copiously with something solventy. I use Muc-Off chain cleaner with a spray tube from a can of WD40 and a small paint brush to get into the gaps, rotating the bearings frequently to get right behind them.
Leave to dry and then repack with tons of good quality grease (keep turning the bearings again), refit the seals and top hats, and good to go.
I have heard folks suggest doing this even before using them as the stock grease isn't great but as long as you don't wait for them to sieze before doing it I'm not sure that's really worth it.
If you're talking about removing bearings from cups and fitting new ones of those – I've just wasted 5 minutes.