We don't really know how he died. When we see the afterlife, it appears that they are all in that moment at once. Everyone dies eventually, so I think that they were all arrived in the afterlife at some point, and that since time doesn't pass really after death, they seem to be all there at once. So while Sawyer appears to have gotten off of the island unharmed, he did die eventually.
I don't think you understand the ending of the show,
At the end of the finale they all join together in a church because they are all wandering around in a flashside ways universe, Which is a state of purgatory almost. They didn't want to cross over yet, They made up this place where there lives were good and better then what had happened - thus causing them to forget eachother. At the church Jack's dad says 'Some died before you' In reference to Ana lucia, Charlie, Locke. And then he says 'And some died long after you.' Referencing to Ben, Hurley, Sawyer & Kate. The survivors of the Ajira flight (And ben and hurley) lived until they were old and died. But for all the people that died before them, They were wandering around in the side ways universe for a very long time before everybody else had died. IF you have more questions, Just message me :)