How to make a Cube act as a button to increment a number on a screen overlay panel in an FPS?

All I want to do is get the buttons in my 3D environment to trigger an increment of 1 in the relative panels on the GUI. A wrong answer would make the mistake number increment by 1 etc.
Theres little online on tackling this specific issue.

You can attach a button component to a cube, it needs a collider as well and your camera needs a physics raycaster.