How does the devil know exactly how to tempt me?
The enemy is the devil, the fallen angel Lucifer, who rebelled against God in his arrogance, not wanting to serve mankind but wanting to serve himself. Everything with the devil revolves around egotism, pride, and his own self-glory. And the devil is a master psychologist. He understands mankind inside and out. All of us have proclivities, a personality, a way we interact with the world, and the devil has been studying and interacting with mankind since the very beginning.
He has logged more hours into this battle than anyone else. He knows the things that make us tick, the things that trigger us, the ways to manipulate us, all our buttons, our propensities, our thought patterns, through the horde of demons that he oversees and commands. He can whisper in our ear: those old cartoons of the little angel and the little demon are just an imagery of how it actually happens in real life.
Each of us even wrestles with particular demons related to certain sins or passions. Somebody dealing with the passion of greed may have a demon specializing in greed, so finely attuned to how people think and work with greed that he is shaping and pushing the person in that direction.

