Registering and unregistering Events on Begin/End of the gameplay in a custom component

I’m creating a custom static mesh component I would like to register and unregister during every begin and end of the game play. at the moment I’m using


and overridden

Endplay(const EEndPlayReason::Type EndPlayReason)

and i find the end play is not getting triggered some times . Help me to understand the best approach. Thank you