Click switch button if its not clicked

Hi all,

Any idea how can I click on a switch button only if the button is not yet clicked?

Here’s what the button looks like:
image

If the end goal is to ensure the switch is clicked, I would just use executejavascript and do something like:

 $("#checkboxId).toggleAttribute('checked');