From the Catholic perspective, freedom is not the ability to do whatever we want to do. It is the ability to live as we ought, according to God’s will. We tend to think that rules and requirements make us less free. However, when applied properly and justly, and when correctly understood, the opposite is true.
Here is an example. Take a virtuoso pianist. He/she has studied and practiced for many years. She/he knows the rules of musical theory, proper technique, etc. This level of mastery of one’s self allows them to express themselves on the piano with great freedom. Whatever they hear and desire to play, they can. Any piece of music they pick up and wish to play, they can. Now, take an untrained person who desires to express his or herself in the same way. They cannot. They are not free because they have not mastered the necessary skills to do so. The training, rules, and requirements necessary to become a master pianist have made them free in a way that the other person will never know.
In a similar way, when we do not master our own desires for sin, money, prestige, etc. we become slaves to that desire. This is where God’s laws and the teachings of the Church come in. If we follow them, we are able to master that desire and we become free to be the person we were meant to be. We remain in the world, but we are not of the world. That, is true freedom.
I hope that helps somewhat.
Peace of Christ,