David Hume was born in Berwickshire, Scotland and educated at home until he was matriculated at the University of Edinburgh around the age of 12. He studied law for the first few years, and then abandoned law for self-study of philosophy. During this time, he began to have serious doubts about religion. He questioned the existence of God and studied Bayle’s Dictionary about these questions. Around the age of 30 he published a work entitled A Treatise of Human Nature. Hume was less than enthused about the public reaction to this work. He tried to gain a position at the University of Edinburgh, became a tutor and then a secretary to General St. Clair. While performing these various duties, Hume reworked his Treatise into a simpler form that eventually becomes An Inquiry Concerning Human Understanding which was published in 1748.
Hume tried again to become a professor at Glasgow University and failed. He then became a librarian at the Advocates Library in Edinburgh. While here, he penned the History of Great Britain from the Invasion of Julius Caesar to the Revolution of 1688. According to some sources, Hume stopped writing about his philosophy at this time because he was satisfied with what he had already written. He also was almost excommunicated from the Church of Scotland around this time.
Hume was very well known and had friends at various times the like of Adam Smith, Edward Gibbon, James Boswell and (for a time) Jean-Jacques Rousseau. He was well liked by all that knew him and was known for his kindness, and this was not more evident when he went to France in 1763 and received a heroes welcome.
Hume fell ill with some gastrointestinal affliction (some say cancer, others dysentery and colitis) and died after a long illness. While sick, he made arrangements to get his Dialogues on Natural Religion published posthumously and met with friends.
Hume’s philosophy was not well received by the clergy during his lifetime, and it is for this reason that he was not hired for the professorial jobs for which he applied. Hume was a skeptic and his skepticism applied to all things, including religion. He argued against the "argument for design" of the universe, he argued that not all societies created religions and that morality is and should only be based on human nature and not divine reward/punishment.
Hume was a virtuous individual and the only fault that could be found against him was his anti-religious writings.
"What danger can ever come from ingenious reasoning and inquiry? The worst speculative skeptic ever I knew was a much better man than the best superstitious devotee and bigot."
David Hume in a letter to Gilbert Elliot, March 10, 1751.
The Hume Archives a great site with many links to works by and about Hume
Timothy Binga, Director, Center for Inquiry Libraries