I am not a native speaker. I hope I have a more or less accurate understanding of what the phrase "count your blessings" means ("not everything is bad, you should not really complain", is that so?), but I am struggling to understand the literal meaning. I only know bless from the context of "God bless monarch/country" and when someone sneezes, but I can't really connect that verb to the countable noun.
What is the origin of the phrase "count your blessings"? Is it known when and in what context it was first used?