The US Military GPS system was based on knowledge gained from the early Sputnik launches from the USSR. I don't expect that the Russian scientists imagined that their satellite would one day help me find my way to the nearest Starbucks, but there you go.
That's just one example, there are others about ICs and so on that I'm not going to list here. We could have done these without space exploration, but we didn't.
But like I said, all these things are by-products. We go to space because the human race has always wanted to explore. Its a fallacy that we're going to Mars, or anywhere else, because we want to colonise it. At least until someone invents terraforming.... Perseverance has gone to Mars to investigate whether life ever existed there. I don't know what we'll do with that information when we get it, but someone does.
Going back to satellites... Einstein came up with the Theory of Relativity in 1905 and it had no application at the time. Guess what? Satellite navigation and GPS rely on knowledge of how relativity affects time. You never know.