hey, if its a button it has a built in OnClicked Event inside. I assume you are using UMG for that.
In the Designer Tab click your button, scroll down in the details Panel, you should see a Button “Add OnClickEvent” or something -> click it and do epic logic