These quotes are not completely incompatible (nor are the thinkers who produced them, David Hume and Epicurus). Both figures explored empirical methodology, and embraced a naturalistic philosophy. Their theological positions were unique, and yet similar in some ways.
Regardless, the first quotation in the attached image is one of the most misattributed quotations on the internet to this day. Here's a meme (with citations) to set the record straight.