Yes, we sometimes spend too much energy trying to help people change, and it's good to be hopeful...but detrimental to yourself to be delusional or even stubborn about their unwillingness to change or want more for themselves too.
After a couple tries and / or years, you just have to accept people as they are and hope for the best. If it means distancing yourself, so be it.
Set realistic expectations and meet people where they are...especially once you're in your 30s / 40s.