"Now to the one who works, his wages are not counted as a gift but as his due. And to the one who does not work but believes in him who justifies the ungodly, his faith is counted as righteousness," - Romans 4:4-5 ESV
This is a cornerstone principle. Trust is the foundation of any relationship. God is basically saying, 'Trust in Me and I will justify you.'
If our relationship with God is based on us and what we bring to the table there is no justification but if it is about who Jesus Is and what He has brought to the table then we are justified. The cross has that power like nothing else does.
If I found out a friend cheated me or betrayed my trust in some way it might damage my relationship with them but if instead I learned that a friend was speaking kindly of me to others and was helping me in ways I was not even aware of it would affect me in a much different way. God has been loving us behind our backs all along and the moment we trust Him we become connected to Him by that love.
Grace must have this element.
"And without faith it is impossible to please him, for whoever would draw near to God must believe that he exists and that he rewards those who seek him." - Hebrews 11:6 ESV
The world is a hard place sometimes but is God good? Yes.
Does God care about us? Yes. He sent His Son as proof that He cares and His Son healed the rift between divinity and humanity.
Unconditional favor is not possible without this understanding. God Is holy. He does not compromise with sin. God has a method that applies favor apart from sin because the transgressions have been blotted out by Christ's blood.
Now I can look at another person and say, 'They are justified because of what Jesus has done.' Their actions are not justified but they are. It isn't what they bring to the table. It is what Jesus brought to the table.
If we think this way we can give grace because this is how the God of all grace is thinking about us.