As long as you always revert back to allah and ask for istighfar you are doing fine. This is your test in life so keep positive thinking engaged and always remember Allah much. Best remembrance is to ask Allah for forgiveness. As for when you go out, I think you need to rethink what sort of friends you are associating with if you don’t feel they help you remember Allah much. Friendship is about consolidating one another on the path of truth and imaan but if your friends are not ones that help you promote your faith further, then you should think again about who you want to hang out with.