"All who rely on observing the law are under a curse, for it is written: 'Cursed is everyone who does not continue to do everything written in the Book of the Law.'" NIV translation
Paul quotes Deuteronomy 27:26 and reminds us that, if you trust in the law for salvation, it is a curse. It is a curse because there is no way that man can keep the law perfectly and the standard is perfection.
"Clearly no one is justified before God by the law, because, 'The righteous will live by faith.' The law is not based on faith; on the contrary, 'The man who does these things will live by them.'" NIV translation
As people, it is easier for us to do something than to trust someone else. That is why so many people fall into legalistic religious traps but, as we see in this passage, it is only by faith that we are declared not guilty of sin. That faith is belief in the fact that Jesus paid our penalty for sin (died) and was raised again.
"Christ redeemed us from the curse of the law by becoming a curse for us, for it is written: 'Cursed is everyone who is hung on a tree.'" NIV translation
Jesus came to the earth and kept the law for us so that He could be the perfect (unblemished) sacrifice. Then, He went and died on the cross (becoming cursed for our imperfection). Our faith in Him, as that perfect sacrifice, is the basis for our right relationship with God.
"He redeemed us in order that the blessing given to Abraham might come to the Gentiles through Christ Jesus, so that by faith we might receive the promise of the Spirit." NIV translation
God's promise to Abraham, in Genesis 22, is fulfilled in us through Jesus Christ. God had promised him that he would have children from many nations and not just his own people. Through Jesus Christ, we are brought into the family of God along with Abraham. Through the same faith that he had, we have salvation and receive the promise of God with us through the Holy Spirit.