Perhaps you're thinking of Jesus' statement that when we know the truth, then it will set us free. He said, "Then you will know the truth, and the truth will set you free" (John 8:32). Some universities even have these words engraved over the entrance to their libraries.
But what truth did Jesus say we need to know in order to be free? It is the truth of His teaching -- because it is from God, and it tells us what we need to believe and how we ought to live. Only then are we free from false ways of living. Only then are we free from the shackles of self-deception and self-destruction.
In other words, Jesus wasn't telling us we ought to be free to live any way we want to -- not at all. When we do that, we ignore God and His plan for our lives, and yet His way is always best. We also become slaves to our own lusts and desires, and eventually those things will destroy us. Jesus warned, "Very truly I tell you, everyone who sins is a slave to sin" (John 8:34).
Have you ever asked yourself why these friends are trying to get you to change the way you're living? The reason is because they care about you, and they know God's way is far better than the way you've been living. Don't turn your back on them, but most of all, don't turn your back on Jesus Christ. Life's greatest freedom comes from knowing Christ and following Him.