Plugin Question

Hi Dev Forum. Once again, I am making a post towards a question, which appears, during my developement sessions.

Short Backround Story:
Me and a few others from our group, are trying to make a game, which is about the Metro of Munich.

Trying to achieve:
To intialise trains better, I want to make a plugin which is similar to BanTech’s SCR Signal setup plugin.

To make this plugin efficient, I want to make a button, which selects a part, which is parented to the train I want to intialise.

Issue:
I have no idea, what I could do, that if you click a button, the part, which is linked to that button, will get selected in the workspace.

List of things, what I have done so far, to resolve the issue:
I have actually searched on this forum for a solution, but I have not found any post, which could help me.

In advance, thanks for answering!