All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
What you mentioned is not apostasy; rather, it is just whispers to distract you from virtue and to make you grieve.
Therefore, avoid these whispers, and seek refuge in Allah from their evil and the evil of Satan.
Allah knows best.