“Becoming like him in his death” means that we take up our cross and follow Jesus. (Luke 9:23-24) As Jesus died to serving sin all through his mortal life, we too must die to serving sin. Jesus made the ultimate sacrifice, by giving his life. Although most of us are not called on to be martyrs, we still have to die to sin — in other words, we have to die to serving the flesh and live for God, as Jesus did. Romans 6:2-11
… How can we who died to sin still live in it? (3) Do you not know that all of us who have been baptized into Christ Jesus were baptized into his death? (4) We were buried therefore with him by baptism into death, in order that, just as Christ was raised from the dead by the glory of the Father, we too might walk in newness of life. (5) For if we have been united with him in a death like his, we shall certainly be united with him in a resurrection like his. (6) We know that our old self was crucified with him in order that the body of sin might be brought to nothing, so that we would no longer be enslaved to sin. (7) For one who has died has been set free from sin. (8) Now if we have died with Christ, we believe that we will also live with him. (9) We know that Christ, being raised from the dead, will never die again; death no longer has dominion over him. (10) For the death he died he died to sin, once for all, but the life he lives he lives to God. (11) So you also must consider yourselves dead to sin and alive to God in Christ Jesus.
Of course, we can never earn salvation — salvation is a gift. Whatever service we render to God and Jesus can never make us righteous. Our righteousness is an attributed righteousness because we have faith in what Jesus has done for us. Our very puny service to God and Jesus is a voluntary response of love to their love.
Philippians 3:9-11 and be found in him, not having a righteousness of my own that comes from the law, but that which comes through faith in Christ, the righteousness from God that depends on faith– (10) that I may know him and the power of his resurrection, and may share his sufferings, becoming like him in his death, (11) that by any means possible I may attain the resurrection from the dead.
Because Jesus has died on the cross for us, we can live. Jesus wants us to associate ourselves with him in this matter of death. As he died for us, we need to die to serving ourselves (serving sin), for him and live for him. 2 Cor 5:14-15
For the love of Christ controls us, because we have concluded this: that one has died for all, therefore all have died; (15) and he died for all, that those who live might no longer live for themselves but for him who for their sake died and was raised.
There are many verses dealing with this theme. For example, Romans 8:13; Romans 8:17; Galatians 2:20; Galatians 5:24; Galatians 6:14; 2 Timothy 2:11 and to end with, 1 Peter 2:27:
He himself bore our sins in his body on the tree, that we might die to sin and live to righteousness. By his wounds you have been healed.