go off on a tangent
US /ɡoʊ ɔf ɑn ə ˈtæn.dʒənt/
UK /ɡoʊ ɔf ɑn ə ˈtæn.dʒənt/

1.
to suddenly start talking or thinking about a different subject from the one you were originally discussing
:
•
The professor tends to go off on a tangent during his lectures, making them hard to follow.
•
We were discussing the budget, but then he suddenly went off on a tangent about his vacation plans.