After many tries to help my friend out of sinning and bad habits, should I just let them be or do I continue to try to help them even if they don't agree?
You should continue trying to help your friend out of sinning as much as you can and whenever you find a suitable time and circumstance to do that. Even if you advice did not work under certain situation, you should keep trying as and when situation is suitable. The prophets and Ahlul Bayt (AS) never gave up advising people despite all the hardships. No doubt, you should be wise and follow the best ways to advise people according to their level of understanding and their circumstances. Allah says in Quran (Invite people to the Way of your Lord with wisdom and nice preaching) ادعُ إلى سبيل ربك بالحكمة والموعظة الحسنة (16:125).
Wassalam.