Unscrew the nut a few threads and tap out the shaft with a copper or nylon-faced hammer.
The most common reason for removing a dynamo pulley is to fit it on a new dynamo — most...