Button to do something when checkbox is ticked

Hi everyone,
I’ve created a checkbox and a button and i want to be able to do something when i press the button but only if the checkbox is ticked, i’ve managed to make it so it tells us to check it if we press the button without checking it, but when press on the checkbox, it proceeds to the function instead of just ticking.