How to delete a specific actor when you click on a random actor?

Hello, yes you understood my problem but I want to know if you can help me, how can i get my GameMode from the actor, is it a function or something?