Is there any way to prevent a block from executing if a condition is not satisfied

Can you post a more detailed example of what you’re trying to achieve? Please use code blocks (clicking the <> button in the editor) to make it easier to read.