At times, the devil apparently does put evil thoughts in our head, or even directly incites us to do evil. I think of Judas, for example, who made a secret arrangement to betray Jesus to His enemies. When Judas went to inform them where they could find Jesus, the Bible says that "Satan entered into him" (John 13:27).
But the ground was already prepared (so to speak) for Satan to work in Judas' heart and mind. Although he was part of Jesus' band of twelve disciples, Judas did not really believe that Jesus was the Savior sent from God to save us from our sins. In fact, the Bible says that Judas "was a thief; as keeper of the money bag (for the disciples), he used to help himself to what was put into it" (John 12:6). The lesson is clear: The farther we are from God, the more vulnerable we will be to Satan's attacks.
Don't be like Judas, but make certain of your commitment to Jesus Christ. If you've never done so, turn to Him and by faith ask Him to come into your heart and life. Then ask Him to fill your mind with His truth and His Spirit every day. The Bible says, "Submit yourselves, then, to God. Resist the devil, and he will flee from you" (James 4:7).
Not all evil thoughts come directly from Satan, however. Often they come from within - from our own sinful hearts. When they do, ask God to cleanse your mind and fill it with Christ.