趁 + [noun / adjective / clause] + [verb phrase]
[subject] + 趁(着)+ [clause] + [verb phrase]
趁 introduces a condition that suits the action and won't last, and the rest of the sentence says what you do while it does. It can take an adjective, a noun or a whole clause.
With a clause, 趁 often catches a moment when someone isn't looking.
趁着 is the same, slightly fuller. 趁机 is "take the chance", and 趁早 is "while there's still time, sooner rather than later".
在…的时候 just says when. 趁 says the moment is an advantage you're using.
A situation that works against the action can't follow 趁.