You can use a different element instead of the label element for the visual part of the checkbox, or radio button or whatever. If you position your checkbox right above the new visual checkbox, and you just set the opacity to 0, it can still be clicked, so you don't have to use the label element to trigger the clicking, and you are free to use the label element as it is supposed to be used.
let me rephrase it:
You can use a different element instead of the label element for the visual part of the checkbox, or radio button or whatever. If you position your checkbox right above the new visual checkbox, and you just set the opacity to 0, it can still be clicked, so you don't have to use the label element to trigger the clicking, and you are free to use the label element as it is supposed to be used.
https://codepen.io/thefairystamp/pen/EXgQdN
Sorry, I just assumed this is regular knowledge.