You are made right with God (justified, rendered righteous) by trusting Jesus.
Know that a man is not justified by the works of the law, but by the trust of Jesus Christ. We have trusted in Jesus Christ that we might be justified by the trust of Christ, and not by the works of the law: for by the works of the law shall no flesh be justified (Galatians 2:16).
You give evidence (are justified) to others that you trust Jesus by what you do.
Trust without works is dead. Now someone may argue, “Some people have trust; others have works.” But I say, “How can you show me your trust if you don’t have works? I will show you my trust by my works.” By works a man is justified, and not by trust only" (James 2:17-18,24).
We show others that we are right with God by what we do, not by trust alone. Other people can't see our internal trust and relationship with Jesus but they can see us expressing our trust through love (Galatians 5:6).
Trust Without Works is Dead?
The context of James 2 speaks of showing others our trust by our works (v18). Invisible trust is as good as dead in the eyes of others. "Works" are acts of love. Loving acts let us show others that we trust Jesus. Jesus said in John 13:35, "By your love for one another all people will know that you are My disciples."
We are saved by trusting Jesus so we don't have to prove anything to God or earn anything from Him by works. Ephesians 2:10 tells us that "Long ago God prepared good works for us to do." Our ongoing trust results in us doing the good works God prepared for us to do.
Without love we are nothing (1 Corinthians 13:2). "Everyone who loves has been born of God and knows God. Whoever does not love does not know God, because God is love" (1 John 4:7). Our trust expresses itself through love (Galatians 5:6) and loving acts are the natural result of walking with our loving Father by trust. Thus "trust without works is dead." Dead means it is a false trust, you are only pretending to trust Jesus, you don't know Him. "Whoever does not love does not know God, because God is love" (1 John 4:18). James and John were talking about the same thing. Works are acts of love done by God through you as you trust Him.