"Freedom is the recognition of necessity" (Hegel)
I learned these words when I was in high school and was very much impressed and cried. These words affected me for my life afterward.
You cannot get freedom by just wishing for freedom or believing in God. I think that freedom can only be obtained by recognizing the necessity of nature and society.
For example, even if you think there is no rock in front of you, if there is a rock, you would hit it when you move forward. However, if you recognize the existence of rock (i.e., necessity) and take measures (mount over it or digging holes underground), then you can get the freedom to move forward.
If you get into trouble, praying in God may be a temporary relief, but you cannot solve the trouble (because there is no God). The trouble can only be solved (or you will get freedom) by finding the root cause of the trouble and taking countermeasures.