The way you tell that your teacher, the Bible or your mom gave good moral advice is you compare it to your own personal morality. You think about it and evaluate it. I know that the tools you use to do that are a hodgepodge of your own intelligence, history, experience and culture and that these are very imperfect tools. Nevertheless they will not steer you wrong all that often.
The purpose of morality is to provide you with a happy life. Albert Einstein once said "The most important human endeavor is the striving for morality in our actions. Our inner balance and even our very existence depend on it. Only morality in our actions can give beauty and dignity to life."
Sometimes you don't know what will help you have a happy life, what will give your life beauty and dignity. That is where living and learning come in handy. Sometimes wise people do give you good moral advice. Sometimes they don't. You have to figure it out. You have to look and evaluate the harm or the happiness that your actions will cause. I urge you to never take moral advice without some thought. Not even mine. I could be wrong. Surely I will be wrong at least once in my life!
When I talk about this stuff to people they sometimes tell me "If you make up your own morality, you could decide to do anything!" That is very true. You could make some whopping mistakes that way. Allowing others to decide your morality leads to much worse in my opinion.
Remember those broken people I mentioned earlier? Some of them are claiming moral leadership and dishing out moral advice. They are telling people to do things that will not lead to peace and happiness. They believe their own happiness depends on money or worship or power. The power to make people destroy their own happiness for the happiness of the leader, for the sake of God's happiness, or worse they teach that happiness is not the goal of morality at all, that being moral means being miserable.
Huckleberry Finn is a work of fiction, but Samuel Clemons knew what he was talking about. The authorities in Huck's life were telling him that morality required Jim's misery and enslavement, that Jim's happiness and freedom were irrelevant. Huck was a barefoot kid with holes in the knees of his pants. He had been handed his morality by others as most children are. Yet he was able to evaluate what he had been told and realized he couldn't cause his friend misery and instead he helps Jim get to freedom.
I get told I'm going to hell on average about twice a week. I'm going to hell because the peace and happiness of "immoral" people are important to me. I'm going to hell because I respect the dignity of people who aren't supposed to have any. That's okay with me. I'll go to hell. I'll be in some great company.