Didn't we just answer a question like this a few days ago?
Tap gently side to side with a rubber mallet while pulling upwards. When reinstalling make sure you get the little baffle at the bottom properly oriented or it will be hit by a crankshaft counterweight and probably broken off. If in doubt about the position, install so that the air intake slit in the filler cap faces forward (towards the fan air blast).