I replaced the bearing on my motor about 6 months ago so may be able to help.
It is very difficult to tell from the photo you posted, but did the bearing come away with the outer casing or is it still attached to the drive shaft as in the photo below
I actually removed the motor from the bike as it was much easier to work on it at a workbench. From the photo you posted it appears as if there has been some water ingress into the motor. The grease on mine was a nice white colour not the discoloured gunge that is in yours.
The main drive shaft that the bearing is on can just be pulled off, [there are no sensors on it - the photo SW posted has nothing to do with this motor] you though do need to exercise some caution as it is a two part shaft with a Drawn cup roller clutch in the centre section. It does need to be kept very clean or you will have problems down the line.
If the bearing is still on the shaft you will need a bearing puller to get it off, do not attempt to lever it off or you will damage the plastic gear wheel. I had to borrow a yoke type puller as my own puller could not get a grip of the bearing due to the small clearance between the bearing and plastic gear.
If the bearing came away with the outer casing then it will be a simple matter of pressing the bearing out, again be cautious as the casing is very thin and could easily be damaged.
The most difficult part was putting it back together - getting gears meshed correctly required a lot of trial and error.
Note the bearing is an Enduro 6809 LLU Max C3 [6809 LUT fitted originally]