In my opinion the confusion comes from a misunderstanding. The fact that society changes doesn't mean basic moral principles are useless, it's more that the *applications* of those principles change. Like, "treat others with respect" has basically stayed the same, but how you apply it changes. Five years ago you might have thought respect meant one thing, now you realize it meant ignoring how the people around you actually felt. It's not that the principle became outdated, it's that you misunderstood it.
The real problem is being able to tell the difference between "I understood a principle I had better" and "fashion is dragging me in a random direction". One thing that helps me is asking myself: if tomorrow this idea wasn't popular anymore, would I still think that way? If the answer is no, it's probably not a real conviction but just something you follow because everyone does. But if it's something that makes rational sense to you, it doesn't become less true just because it's not trendy.
And honestly, everyone changes their mind about a lot of things. Sticking to your beliefs doesn't mean being stubborn, it means having a foundation to reason from while everything around you moves. But being willing to listen when you're wrong about something is important too. The point isn't to win the moral argument, it's to understand what's actually right for you.