The answer is found by looking to the future and the eternal hope promised to every Christian, which is the context for the command to sufferers to rejoice in difficult times. In Romans 12:9–21, Paul is addressing the marks of a true Christian—the manifestations of new religious affections in the lives of those who have been justified through faith in Jesus, who are indwelt by the Holy Spirit, and who are being conformed to the image of their Savior. The key manifestation is love for Jesus and for those redeemed by Him (v. 9). Such love is drawn toward the good while abhorring evil. It can be seen in brotherly affection and honor (v. 10), as well as in zeal and sincerity in serving the Lord (v. 11).
In verse 12, Paul gives us the context for rejoicing in times of trial: “Rejoice in hope.” The reason why Christians are commanded to rejoice in the midst of trials, suffering, and persecution now becomes clear. By looking to the future, Christians know that their trials, however difficult, are temporary, and that when all is said and done, God promises to turn every current trial to our eternal good (8:28). True joy is not grounded in personal sentiment or emotions (“I feel joyful”), nor in a stoic resolution to bravely face the future. Rather, it is grounded in the fact that the crucified Savior who died for our sins so as to turn aside the wrath of God was also bodily raised from the dead and will come again in fulfillment of all His promises.
Christians rejoice in times of trial and suffering because doing so emulates the saving work of Jesus, who suffered and died before being raised from the dead and exalted to the right hand of the Father, where He rules over all things. The pattern established by Jesus—suffering precedes glory—holds true for all those who trust in Him and are united to Him by the Holy Spirit. Just as Jesus suffered and was raised, we are promised the same thing. Our suffering, trials, temptations, and persecution will give way to all the blessings Jesus has promised to us—the future hope of which Paul often speaks (see 1 Cor. 15:19; 1 Thess. 5:8; 2 Thess. 2:16–17).