I did a post on this before, feel free to read:
"There's a difference between the sunnah and the hadith. The hadith is a so called saying of the prophet which cannot be proven to be authentic or true. The word Hadith is often understood to be a synonym for the word Sunnah. This is not correct. There is a great difference between the two not only regarding the extent of their authenticity, but also their content. So the first thing to understand is, a hadith can be unathentic or false, whilst the sunnah cannot.
This is mainly to do with the difference in transmission. The hadith has been translated by a few individuals, so it usually depends on their character, memory, or intellect, all of which can be affected even if said individual is pious. Whilst the Sunnah has been transfered by a entire generation to the next, the amount of people who practice the sayings of sunnah remove the possibility of the error. The memory of a few people can alter a message, but the memory of a thousand people can weed out the faulty messages.
One more thing to note is that the sunnah is only related to the practical parts of Islam, such as the hajj, prayer, etc. Whilst a hadith is not confined to a certain part of Islam, the contents vary from history, practices, and even explanations to the Quran and sunnah. And lastly, the Sunnah is not based on a hadith. Muslims do not pray, or do hajj in the way they do, because of the narrations of a few indivuals. To end this, the Sunnah is an independant soruce for Islam.
A hadith will never be equal to the Sunnah and the Quran. End of story."
What's important to know is that the hadith appeared 180 to 300 years after the prophets death, no steps were used to preserve the actions of the prophet, thus unreliable. The hadith are only there for you to understand a topic deeper, never use the hadith as a reason for claiming something nor should you base anything based on a hadith, use the Quran and Sunnah.