Go off on a tangent

To suddenly change one’s line of thought or course of action.

The speaker suddenly went off on a tangent and began to speak about something totally different.