A preposition at the end of a sentence is also known as a stranded preposition. It is a grammatical myth that a sentence in English should never end in a preposition, and this rule originates from the Latin-obsessed 17th century. For the next two centuries teachers and grammarians very seriously tried to enforce it.
English is not Latin and the deferring of prepositions is part of English. If you wish to be a pro-Latin grammar elitist—maneuvering all prepositions to the end of a sentence—you might end up sounding like Yoda in Star Wars.
A well known witticism that illustrates this point very well, is: "This is the sort of English up with which I will not put!"