How does wormtail die in Harry Potter and the deathy hallows?

He died in the Malfoys basement when Harry and co where trying to escape. In the 3rd book Harry stopped Remus and Sirus from killing Wormtail, this ment that Wormtail owed Harry. So when he tried killing Harry in the 7th book in the Malfoys basement Harry reminded him of this and so Wormtail killed himself with his magically made hand which Voldemort gave him.