How fortunate that your whole life isn't over yet, so you can keep learning. I learn stuff here all the time. I'm wrong often enough, but not about this one.
Don't feel too bad. People who'd be taught their whole lives that Earth was the center of the universe suffered worse fates than a rule for suggesting otherwise.
(I don't take quite the same degree of descriptivist approach as Kooyeen. I have "standard business English" as my standard, not "whatever people say makes it correct," but honestly, really, and truly, there is NO RULE about never ending sentences with a preposition. People takes cases like "Where're you at?" which is nonstandard, and over-apply them to things like your "What do you need to go to the store for?")