If you are deemed to be making an attempt at interrupting play, then you are offside, that's why some people are called offside when they run for the ball without actually touching it.
Best course of action if you find yourself in danger is to do nothing at all. In Cardozo's defence, he didn't know he was offside but still...