I see visions of old cartoons from my memories of a devil on one shoulder and an angel on the other, both competing for the persons decision. This actually harkens to the Islamic belief of jinn. Regardless of where it comes from, there is some truth to the fact that evil spirits can swing someone's mood and/or entice. In this case, the evil spirit was sent from the Lord.
Jonathon talked sense into his father, and Saul was convinced and wasn't going to harm David. However, it didn't take long before a bad mood brought about Saul's darkest desires, which gave birth to a pursuit of murder.
We can be like Saul, we can also have dark desires and circumstances and a certain emotional state can bring these things out in us. So the question is, how can we avoid those circumstances and emotional state? I don't know what works the best, but often times I simply do my best to avoid those circumstances and/or replace those thoughts with more godly ones. Jesus uses the Word of God to fend off temptation - which is probably the best way to handle any temptation.