you might wanna instead make some paragraphs when laying down different points, makes it easier to digest kkkkkkkkkkThe more you say why does this happen and so on the more your going to be stuck in this loop of misery and doubts, the only solution is to shut them down. We know Allah exists as there's so many evidence to suggest this. So if we know Allah exists we should surely put our trust in him. Since he literally created you and is keeping an eye on you e.g you being alive and the universe being alive etc. It wouldn't make sense having doubt in your faith when we know Allah exists and is everywhere with us through his wisdom. Imagine being a murtad and you know Allah exists, does that make sense? what will happen when you die? you think Allah will.be pleased? absolutely not but rather you will relieve a welcome to an eternal misery with no hope of redemption. But to answer your question. Allah created shaytan for the same reason why Allah created us. Remember the verse, “And I did not create the jinnkind and the mankind except to worship me.” So this tells us that Allah created Shaytan who is from the jinnkind so that Shaytan can worship Him. But since Shaytan also had free will, he used that to disobey Allah. Shaytan than went on to further threaten to get humanity to disobey Allah. Humans have free will and WILLINGLY choose to follow shaytan just like the waswas your getting, you are willingly allowing it to get to you when you can just simply seek the truth to get your answer and not entertain the doubts. This is not the fault of shaytan as he's only giving you invitation to hellfire. This is the fault of humans by accepting his invitation and willingly disobeying Allah. Shaytan is also a test for us to see if we will follow him or follow Allah. Ofcourse us human beings aren't perfect and that's why Allah doors ti forgiveness is always open no matter how many sins you commit. And the correct answers we are giving you should make any muslim satisfied because its the truth. The Quran is the truth the sunnah is the truth so there's nothing to worry about unless you invite these worries.