Creating a Function with a Mandatory Choice of Two Options Using a Button

How can I create a function that presents two options to the user through a button, making the choice mandatory and executing a specific action based on the selected option?