Never forget that the devil's sole goal is to block whatever God is doing, and sometimes his hand is very obvious. Many times in my own ministry I have sensed that the devil was trying to stop something God was about to do, and this made us pray more fervently and trust God even more.
But often we don't know whether God has sent something into our lives or if it came from the devil—and frankly, it doesn't really matter! The only thing that matters is our response: Will this temptation or difficulty drive us closer to God, or will we let it overwhelm us? The Bible says, "Submit yourselves, then, to God. Resist the devil, and he will flee from you. Come near to God and he will come near to you" (James 4:7-8).
I often think of Joseph in this regard. (You can read about him in chapters 37-50 of Genesis.) As a young man, he was sold into slavery by his jealous brothers and taken to Egypt. But in time he became the prime minister, and God used Joseph not only to save the Egyptian people from famine but to provide a home for his people, the Jews. Later, he told his brothers, "You intended to harm me, but God intended it for good" (Genesis 50:20).
You see, even when bad things happen to us, God hasn't forgotten us. He still loves us, and He can use these things for our good. Whatever comes your way, turn it over to Christ and ask Him to help you grow closer to Him. When you do, Satan will be defeated and God will be glorified.