What happens to campaign donations when a candidate isn’t elected?

I am seeing more people talk about officially running for president. Seems like one reason to announce this early is to form a team and start collecting campaign donations. But if they drop out or don’t win their primary where does the money go that wasn’t spent?
What happens to campaign donations when a candidate isn’t elected?
Post Opinion