Digression
Derailment
noun, verbal noun
When you're trying to escape from the line, you're trying to make a digression. I mean, that's basically what a digression is—an escape from the main line of thought.
In a completely different context, this word is also used to refer to train (and other sorts of) derailments. Try to keep that one in the back of your mind.
This is a jukugo word, which usually means on'yomi readings from the kanji. If you know the readings of your kanji you'll know how to read this as well.
話が脱線しました。
The conversation got sidetracked.
電車が脱線しましたが、ケガ人はありませんでした。
The train was derailed, but nobody was injured.
すいません、また脱線してしまいました。
Sorry, I got sidetracked again.