To go through this test, our Creator has given us His guidances and knowledge of the way to succeed in this test in a number of ways. The first among these is the basic sense of distinguishing between good and evil. We know that truthfulness, honesty etc. are desirable and that the opposite behavior is wrong. Besides this, our Creator has also guided us through his prophets and messengers. There is this knowledge that our Creator has given us on the one hand, while on the other, we have been given the desire to deviate from the path.
Evil thoughts come to our mind.
We get opportunities to do wrong for our immediate pleasures. All this is a part of the test that we are faced with. The ultimate object of this test is to see who among us goes through life in such a way that would cleanse him from all evil and thus qualify him for the everlasting bliss. We are required in this life to control our desires and follow the path that our Creator likes, even though we are greatly attracted to do otherwise. My dear brother, as a part of this test, evil forces and evil thoughts are allowed to exist in this world.