I see that 「念のために」 is an expression that means "just in case" in general, but how does one express "I'm going to do A in case B happens"?
For example, "I'm writing in pencil in case I make a mistake." Would that be translated simply as 「間違えるから、鉛筆で書いています。」, or is there a better way to capture the nuance of doing something expressly for the purpose of insurance against some other possible occurrence?