Alhamdulillah that this forum benefitted you and that you're concerned about your deen.
I don't really have much advice except that we all have our weaknesses, and none of us are perfect, but the only way out is to turn to Allah, and whenever you fall, turn to Allah, and ask for sincere help... because you have to be sincere.. it comes from deep within, so find that sincerity, and then ask Allah, and turn to Allah and repent and cry and proper ask... and keep asking every day and keep asking even after you think you've bettered because we always have to be thankful to Allah, it isn't us guiding ourselves, it's Allah that guides us, and it's Allah that allows us to worship Him alone, and He gave us understanding... so ask Him and be sincere.
Secondly if you don't really have good friends I'd say leave them... I think we all have to do this when we want to get more serious with what we truly believe in, or perhaps that's not the case for you then in stead alhamdulillah, spend more time with them which insha Allah should help to encourage and motivate you.
It can be done alone, but I'd assume sometimes it gets hard, you need that push, a driving force and though you need quite a bit of it in yourself, when you stumble, and you need encouragement good company would be beneficial. But of course the best thing and you should do this also is to turn to Allah and make dua. You won't get anything without asking Allah.
And probably the only other idea I have is to learn about Allah... that way it'll increase your imaan, and it'll increase you in taqwa, because when you know Allah and His Attributes you stay away from sin, or at least you try to, because you know the consequences and you truly believe it. And alhamdulillah after I learnt like probably not even a lot, just a bit, I realised that my imaan had increased, and I realised change so insha Allah it'll work for you too.
Keep at it and don't give up, it's a struggle for each one of us every single day, you know our nafs and shaytaan, it is hard... but do you believe in the aakhira, and if you do.. then you'll struggle through it and win every fight there is to be fought within yourself.. and even if you lose one time, pick yourself up, and try again and keep turning to Allah.
May Allah make it easy for you. Ameen.