The ending of The Wolverine (2013) shows Logan defeating the villain Yashida inside the Silver Samurai and finally accepting that Jean Grey is gone. Yashida is beaten after Mariko and Logan work together, Mariko becomes head of Yashida Industries, and Yukio stays at Logan's side.
Why was Logan not healing? The robotic parasite on his heart was suppressing his healing factor, which is why his wounds stayed open after the funeral attack, and cutting it out is the turning point of the second half. In my reading, that is also the film's real argument: Yashida's offer in Tokyo was a trap dressed up as a gift, because the man who asked to take Logan's power was the one who had faked his own death. The 1945 opening pays off here, since Logan saved a young officer from the Nagasaki blast and that same man spent decades planning to harvest the reason Logan survived it.
It could be argued that the Silver Samurai fight works better than most third act set pieces in the series because it is personal. The suit slices off Logan's adamantium claws, so he needs Mariko's help, and she is the one who stabs Yashida with Logan's claws. That choice gives Mariko the final blow instead of leaving it to the hero. Weta Digital built the suit, with stunt performer Shane Rangi doing motion capture on stilts, which is why the giant moves with real weight next to the actors.
The farewell to Jean is the emotional close. Compared with the more operatic handling of Jean in the team films such as The Last Stand, this version is quiet, and it clears the ground for Logan to rejoin the wider mutant world, which the mid credits scene then does. There is also a pattern worth tracing across the trilogy: in X-Men Origins: Wolverine Logan retreats to a quiet life as a logger in Canada, here he is a hermit in the Yukon, and by Logan (2017), set in 2029, his healing power is fading for good. Each film starts by pulling him out of hiding, and James Mangold, who directed this one and Logan, treats the loss of that power as the thread running through both. If you want to see where the Wolverine line lands next, the follow up is Logan (2017).