Although your high school English teacher may have taught you to never to end a sentence with a preposition, the truth is that ending sentences with prepositions is a widespread and generally accepted feature of standard modern English. In fact, there are times that the only way to phrase a sentence well is to end it with a preposition.

Conclude some passive sentences with a preposition. There are certain passive constructions that warrant, and even demand, that the sentence be finished with a preposition. For example, the passive sentence, "The party was called off" ends with a preposition; if it were rephrased so as not to end with a preposition, it would turn out sounding very awkward: "Called off was the party." So, if you must end a passive sentence with a preposition for it to sound natural, do it without any qualms.

Put a preposition at the end of some sentences with relative clauses. For example: "She was unaware of the importance of the man she stood beside." If we rephrased this sentence to attempt to have it not end with a preposition, it would sound like very unnatural English: "Of the importance of the man she stood beside, she was unaware."

Finish some questions with a preposition. If a question has a verb that is linked with an adverb or preposition, putting the preposition at the sentence end may be the only normal sounding way to phrase the sentence. For example, if the question, "Who are you giving that coffee to?" is rephrased as "To whom are you giving that coffee?" it sounds rather stuffy. Both options are correct, but the first (which finishes with a preposition) certainly sounds the most natural and would be the choice phrasing of almost every native English speaker.