Lose one’s train of thought

To forget what one was talking or thinking about.

I lost my train of thought when I was talking on the telephone to my friend.