Like other topics in Scripture, such as 'sanctification', there are two inheritances, to simplify things. One is based on relationship, and the other is earned. Not knowing which is which is what results in confusion among believers.
I think the best verse that speaks of both inheriances is Rom 8:17 - Now if we are children, then we are heirs —heirs of God and co-heirs with Christ, if indeed we share in his sufferings in order that we may also share in his glory.
I've color coded for ease of explanation. The red words are about the guaranteed inheritance based simply on relationship. As a child of God, the believer is guaranteed to live with God for ever. It is not earned or deserved, but based solely on being a child of God.
The blue words refer to potential inheritance as "co-heirs with Christ", but ONLY IF IF IF believers "share in His sufferings", and the result will be that "we MAY share in His glory", the purple words, a clear reference to His Millennial reign on earth.
Rom 8:17b is also clearly stated in 2 Tim 2:12 - if we endure, we will also reign with him; if we deny him, he also will deny us;
Here, "enduring" is equivalent to "sharing in His sufferings" in Rom 8:17. The result will be to "reign with Him", equivalent to "sharing in His glory" in Rom 8:17.
And, Paul added the negative to this inheritance; those believers who don't "endure" will be denied "reigning with Him" in glory.