How do I repel objects via button press?

I am new to unity and i am currently creating a magnetism game, I am having trouble repeling objects via a button press can anyone help?

You should know which object will be affected by button press. Simply you can choose an object with raycasting and storing that object as currentChoosenObject, and then after pressing that button you can simply add force to that currentChoosenObject at any direction you want.