I want to know why did the Sound and Sand Villages want to destroy the Leaf Village? Also, later on, how had the Sand and Leaf Villages made up with each other?
It's been a while since I watched Naruto. But I believe it was because of the following reasons. If you haven't already gone through the whole arc, then these might be spoilers for you up ahead.
Orochimaru obviously had a personal grudge against the Hidden Leaf village and the Third Hokage who was also his former mentor. And it was him who put an end to his secret experiments back when he was still a leaf shinobi. He continues his quest for immortality and wanted to destroy the village for his personal reasons. He managed to compel the Fourth Kazekage for assistance in destroying the hidden leaf. The Sand village was suffering badly economically and the Fourth Kazekage saw it as an opportunity to improve their economic condition by taking over the Hidden Leaf and also severely weakening the Leaf Shnobi forces, thereby naturally creating more opportunities for the Sand shinobi to get hired for missions. Orochimaru however, betrayed the fourth Kazekage and killed him. He himself then posed as the Kazekage at the Chunin exams to successfully infiltrate the Leaf village.
For the next part of the question:
The sand village's already financially weak state got worse when they realized that the Kazekage had been murdered and their team including their trump card, Gaara had been defeated. Although they emerged victoriuos after a great loss, the Leaf village still let the Sand village off even after they had tried to destroy them, mostly because it had been Orochimaru who had been pulling the strings. Gaara was brought back to his senses after going on a rampage. The Sand village owed the Leaf. And Gaara himself owed a personal debt to Naruto for stopping him and making him see things clearly. When they heard about the Leaf crisis when Sasuke abandoned the village and there were no Jounin level ninjas available, the Sand village dispatched Gaara's squad to assist to settle their debt and also extend a hand for a Sand-Leaf alliance. I am not entirely sure about this but I think it was Tsunade who managed to get the Sand village to assist in the situation.