This is Satan taking control over you. You shouldn’t surrender to him and you should fight it. You must surround yourself with practicing brothers who would always check on you and help you to be steadfast on the straight path.
No matter what happens, always remember that Allah is forgiving and most merciful.