If you need a refresher on the ending, my best advice is to study Chapter 15: A Retrospection. In this chapter, Sherlock Holmes gives us a great summary of pertinent events in the Hound Of The Baskervilles. He ties up loose ends by explaining the whole case to Watson.
According to Watson, Mr. Stapleton was a Baskerville. He was actually the son of Rodger Baskerville, who was Sir Charles' younger brother. This Stapleton character married a Costa Rican beauty, Beryl Garcia. Being an avaricious man, Stapleton concluded that he needed to get rid of the two individuals who stood between him and the Baskerville fortune if he was to enjoy great wealth.
Stapleton accordingly settled near his ancestral home and started cultivating friendships with Sir Charles and the neighbors. Oblivious to Stapleton's true intentions, Sir Charles confided to his new friend his fears surrounding the legend of the Baskerville hound. Stapleton, having gained knowledge of Sir Charles' heart condition, plotted to use the legend as a means to facilitate the baronet's death. For this purpose, he purchased the fiercest and strongest hound money could buy in London.
However, Stapleton found it difficult to catch Sir Charles out of doors at night, on account of his fears regarding the legendary Baskerville hound. Stapleton tried to enlist his wife, Beryl, to sexually entice Sir Charles, but she refused to participate in his machinations. Holmes tells Watson that threats and blows from her husband were insufficient to change her mind. Stapleton soon turned to a Laura Lyons for help. He managed to enlist her help by hinting that he would marry her if she got a divorce. Stapleton manipulated Laura to arrange a meeting with Sir Charles and then perversely prevented her from showing up to the meeting. Instead, Stapleton showed up and let his hound loose upon Sir Charles. The hound chased the baronet relentlessly. Due to the fright, Sir Charles died of a heart attack.
Stapleton's next goal was to kill off Sir Henry Baskerville, the other possible heir to the Baskerville fortune. Despite her fear of her husband's terrible temper, Beryl secretly warned Sir Henry that his life was in danger. Meanwhile, Stapleton bribed employees of the hotel where Sir Henry was staying in order to obtain one of Sir Henry's boots. This was for the purpose of acclimating the hound to Sir Henry's scent. By this time, Holmes had ascertained that Stapleton was Sir Charles' murderer. He resolved that the only way to catch Stapleton was to use Sir Henry as bait. Poor Sir Henry!
On the day of Sir Henry's supposed murder, Beryl learned that she had a rival for her husband's affections. She was furious, and Stapleton suspected that she would betray him. So, he tied her up and rationalized his actions by resolving to woo her affections back after Sir Henry's murder. However, unluckily for Stapleton, he did not bargain for Holmes, Dr. Watson, and Lestrade, who stood ready to defend Sir Henry.
When Stapleton let the hound loose upon Sir Henry, all three men shot at the monstrous dog, which, on account of the phosphorus around its muzzle, seemed to be spewing fire out of its mouth. At the last moment, Holmes managed to save Sir Henry by firing five extra rounds into the animal. Stapleton himself was never caught, and his wife asserted that he had probably fled into the Grimpen Mire.
Watson's final question to Holmes was how Stapleton could have claimed the Baskerville fortune without 'causing suspicion or inquiry' if he had succeeded in killing off Sir Henry. Holmes answered that Stapleton could have done it by either claiming the fortune from abroad, by utilizing an elaborate disguise to conceal his true identity, or by hiring someone else to claim the fortune on his behalf.
The chapter ends with Holmes and Watson making plans to have dinner at a restaurant before going to the opera.