Spin One’s Wheels

What does the idiom “Spin One’s Wheels” mean?

Definition:

Engaging in activity that yields no progress; getting nowhere

For example:

“I’ve been working on this math problem for four hours, but I’m just spinning my wheels. It’s time to take a break and look at it from a new perspective.”