The Greek word for justified is 'dikaioumenoi' the passive participle of 'dikaiow', which means to be declared righteous or pronounced righteous. In the context of this passage the one who justifies is God. He declares sinners to be righteous in His sight if they look by faith to the righteousness that He has provided in Christ (vv. 21-22). All have sinned and fallen short of the glory of God (v. 23) so all need the righteousness that Christ provides. All can be justified (absolved, pronounced righteous, declared righteous) if they will look to Christ alone for their salvation. One's ethnicity, one's social status, one's education or income are not barriers to God: He will justify anyone who calls on His name through the merit of Christ.
This is all by "grace as a gift" (vs. 24). We cannot earn this declaration nor can we obligate God to give it to us if we meet certain conditions. It is freely offered and freely given because of his gracious nature. Psalm 103 captures this well:
"Bless the LORD, O my soul, and forget not all his benefits, who forgives all your iniquity, who heals all your diseases, who redeems your life from the pit, who crowns you with steadfast love and mercy, who satisfies you with good so that your youth is renewed like the eagle's...He does not deal with us according to our sins, nor repay us according to our iniquities. For as high as the heavens are above the earth, so great is his steadfast love toward those who fear him; as far as the east is from the west, so far does he remove our trangrssions from us. As a father shows compassion to his children, so the LORD shows compassion to those who fear him. For he knows our frame; he remembers that we are dust."
Stop working to earn or merit God's approval. It is given freely to those who acknowledge that they are hopelessly sinful (Romans 3:10-20) and who look to Christ alone as the one who has done what they cannot ever hope to do: Keep God's commandments perfectly. Ask God to have mercy upon you, to cleanse you from you sins, and to give you the righteousness of Christ.