Jesus died for all: My little children, I am writing these things to you so that you may not sin. But if anyone does sin, we have an Advocate with the Father, Jesus Christ the Righteous. He is the propitiation for our sins, and not for ours only, but also for the sins of the whole world (pro totius mundi.)—1 John 2:1-2.

Jesus died for many: And He took a cup, and when He had given thanks, He gave it to them, saying, “Drink of it, all of you, for this is My Blood of the covenant, which is poured out for many (pro multis) for the forgiveness of sins.”—Mt 26:27-28.  (Notice the Eucharistic prayer uses exclusively pro multis.)

This apparent contradiction is solved by the infallible Council of Trent: But though He died for all, yet all do not receive the benefit of His death, but those only to whom the merit of His passion is communicated; because as truly as men would not be born unjust, if they were not born through propagation of the seed of Adam, since by that propagation they contract through him, when they are conceived, injustice as their own, so if they were not born again in Christ, they would never be justified, since in that new birth there is bestowed upon them, through the merit of His passion, the grace by which they are made just.—Chapter 3, Session 6, Council of Trent, 13 January 1547 under Pope Paul III.