Romans 3:26: He did it to demonstrate his justice at the present time, so as to be just and the one who justifies those who have faith in Jesus.
God gave Jesus as an atoning sacrifice for the sins of the world. Essentially God gave himself, which is why the deity of Christ is so important. If Jesus were not God, then the sacrifice would not have been sufficient. We would still have to be offering sacrifices just as they did in the Old Testament if Jesus were not God and if he had not died on the cross.
God did this so he could be both just and the one who justifies. He pronounces us guilty, which we are, and then pays our fine so to speak.
If God just turned a blind eye, or ignored our sins, He would not be just. There would be no justice in that case. But God is just, and does punish sin. But in his great love, God gave himself to take our punishment so that we could be reconciled to Him.
God has always been just and has always loved his creation. God gave his son as a way to demonstrate, or show us, his justice and his love at the same time.
In the verse, the words “just” and “the one who justifies” is from Greek words that are most often translated “righteous.” The verse could easily be translated, God is both righteous and the one who declares righteous those who believe.
Our justification, or righteousness, is a gift totally. There is nothing we can do to obtain this except to believe and trust in the one who has made the sacrifice.