A theory states that doing anything over and over again gets you bored fast (like riding an elevator up and down again and again). You can do the same with a nagging thought. Repeat the worry to yourself slowly. The monotony will stop you from escalating, getting sucked into a worry spiral and will likely make your mind wonder to other more productive thoughts.