I don't think that you yourself control your thoughts because I don't think that any human being does? Let me try this another way since the Sermon on the Mount doesn't seem to work. Have you seen Lord of the Rings? Do you recall in the Fellowship of the Ring, that everyone wants the ring and no one but a hobbit can throw it back into the fire? Do you notice how the mere sight of the ring drives them to want it? Do you remember where the Dwarf tried to smash it with a hammer? Do you remember when Gollum first came into possession of the ring that he murdered his best friend to get it?
I'm not familiar with Lord of the Rings. But this works if you give it a try. Paul says: “For though we walk in the flesh, we do not war after the flesh: (For the weapons of our warfare are not carnal, but mighty through God to the pulling down of strong holds
Casting down imaginations, and every high thing that exalteth itself against the knowledge of God, and
bringing into captivity every thought to the obedience of Christ;” (2 Corinthians 10:3–5) (KJV 1900)
Just as Christians flip the channel on TV or radio when something contrary to Christ appears, so we can censor impure thoughts before they develop. You can thwart them at the impulse stage. And replace them with good spiritual thoughts. Job did this. “I made a covenant with mine eyes; Why then should I think upon a maid?” (Job 31:1) (KJV 1900)
So Job not only looked away from probable temptation, he refused to think about it too. Casting down imaginations.
Hatred is the source of all sin, so it is easy to censor hateful thoughts before they develop, replacing them with loving thoughts.
Jesus is God, and God is Love, so Jesus is Lord of our hearts when love forms all of our thoughts and actions. It's not about legalism and cold mechanical works.