What should be one’s attitude to friends who may pray and fast, but engage in different types of sin?
The attitude is one of care and love. One should encourage such people to continue their worship, but also one should remind them that they should not waste the reward they earn for their good deeds by committing bad ones. One should give such reminders when one is sure that they will be well received.
You do not tell a person that drinking intoxicants is forbidden when he is sitting with a group and they are all drinking. He would not respond well to such a reminder. You may give him such an advice when he is sober, ready to discuss matters on their merit. But care and sound advice should always be our standard approach. Outright condemnation is wrong and counterproductive.