German-born Anne Frank is surely the most unusual best-selling teenage author of the 20th century. She penned but one volume, a diary, while hiding from the Nazis during the German occupation of the Netherlands.

“How wonderful it is,” she wrote in that tiny hideaway, “that nobody need wait a single moment before starting to improve the world.”

Imagine it. Living each day for two years crammed behind a bookcase in an office building, knowing that without notice you might be found and hauled off to near-certain death at a concentration camp. Barely a teenager, she managed to write those and many other remarkable passages before she and her family were discovered in August 1944. They were sent to the Bergen-Belsen camp, where Anne died in March 1945, just three months before her 16th birthday.

How is it possible for a youngster to see so much light in a dark world, to find within herself so much hope and optimism amid horror? What insight! What power! That’s been the magic of Anne Frank for the past seven decades.

When Anne was four, her parents fled Germany. That was in 1933, the year the Nazis came to power. The Franks sought refuge in Amsterdam but then were trapped there when Hitler occupied the Netherlands in May 1940. Two years later, with persecution of Jews escalating, they went into hiding.

Eight days into her diary, on June 20, 1942, Anne wrote this reflective note about her undertaking:

For someone like me, it is a very strange habit to write in a diary. Not only that I have never written before, but it strikes me that later neither I, nor anyone else, will care for the musings of a thirteen-year-old schoolgirl.

Little did she know that once her writings were found and published after the war as The Diary of a Young Girl, she would be immortalized as an icon of the Holocaust and beloved by millions the world over. That’s not only because of her remarkable eloquence at such a young age but also because of her undefeatable attitude. It was one of optimism, hope, service to others, and, perhaps most important of all, gratitude for the good she saw in a war-torn world.

This entry from April 5, 1944, just four months before the last thing she would ever write, will touch almost anybody’s heart:

I need to have something besides a husband and children to devote myself to! I don’t want to have lived in vain like most people. I want to be useful or bring enjoyment to all people, even those I’ve never met.

Her diary is full of such uplifting sentiments. One would expect to find endless tales about the privations and claustrophobia of confinement, fearing discovery at any moment. Not from this girl! Yes, there are dark moments and candid admissions of temptation, even disdain and disappointment, but just when you think she’s down and out, she bounces back with observations like, “In spite of everything, I still believe that people are really good at heart.”

In a remarkable 2008 book by Robert A. Emmons titled Thanks! How Practicing Gratitude Can Make You Happier, the author reveals groundbreaking research into the previously underexamined emotion we call “gratitude.” As defined by Emmons, gratitude is the acknowledgment of goodness in one’s life and the recognition that the source of this goodness lies at least partially outside oneself. I think this was the secret to Anne Frank’s character.

Years of study by Emmons and his associates show that “grateful people experience higher levels of positive emotions such as joy, enthusiasm, love, happiness and optimism, and that the practice of gratitude as a discipline protects a person from the destructive impulses of envy, resentment, greed and bitterness.”

Gratitude isn’t just a knee-jerk, unthinking thank-you.

A grateful attitude enriches life. Emmons believes it elevates, energizes, inspires, and transforms. The science supports him: research shows that gratitude is an indispensable key to happiness (the more of it you can muster, the happier you’ll be) and that happiness adds up to nine years to life expectancy.

Gratitude isn’t just a knee-jerk, unthinking thank-you. It’s much more than a warm and fuzzy sentiment. It’s not automatic. Some people, in fact, feel and express it all too rarely. And as grateful a person as you may think you are, chances are you can develop an even more grateful attitude, a task that carries ample rewards that more than compensate for its moral and intellectual challenges. If Anne Frank could do it with all that was going on around her closeted world for two years, you and I have few excuses for failing to muster it as well.

English writer, poet, and philosopher G.K. Chesterton once said, “I would maintain that thanks are the highest form of thought; and that gratitude is happiness doubled by wonder.”

Think about that, especially Chesterton’s use of the word wonder. It means “awe” or “amazement.” The least-thankful people tend to be those who are rarely awed or amazed, in spite of the extraordinary beauty, gifts, and achievements that envelop us.

A shortage of wonder is a source of considerable error and unhappiness in the world. What should astonish us all, some take for granted or even expect as an entitlement.

We’re moved by great music. We enjoy an endless stream of labor-saving, life-enriching inventions. We’re surrounded by abundance in markets for everything from food to shoes to books. We travel in hours to distances that required a month of discomfort for our recent ancestors.

If you want to make a better world, start by making a better self.

In America, life expectancy at age 60 is up by about 8 years since 1900, while life expectancy at birth has increased by an incredible 30 years. The top three causes of death in 1900 were pneumonia, tuberculosis, and diarrhea. Today, we live healthier lives and we live long enough to die mainly from illnesses (like heart disease and cancer) that are degenerative, aging-related problems.

Technology, communications, and transportation have all progressed so much in the last century that hardly a library in the world could document the stunning accomplishments. I still marvel every day that I can call a friend in China from my car or find the nearest coffee shop by using an iPhone app. I’m in awe every time I take a coast-to-coast flight, while the unhappy guy next to me complains that the flight attendant doesn’t have any ketchup for his omelet.

None of these things that should inspire wonderment were inevitable, automatic, or guaranteed. Almost all of them come our way by incentive, self-interest, and the profit motive, from people who gift their creativity to us not because they are ordered to but because of the reward and sense of accomplishment they derive when they do.

Some see this and are amazed and grateful, happy and inspired. Others see it and are envious and unappreciative, angry and demanding.

Which are you? The answer may reveal whether you’re a person who will leave the Earth a better place or a place that will regret you were ever here.

Anne Frank’s message will be remembered for many more decades to come, hopefully forever. It reminds us that, no matter the circumstances, we can brighten our lives and those of others around us. We don’t have to sink into despair. We can find good in the smallest of things that can overwhelm the biggest of evils. Our attitude, the old saying goes, determines our altitude. If you want to make a better world, start by making a better self; it’s the one thing you have considerable control over in almost any situation.

Anne Frank didn’t live long enough to see or possess very much. But because she found within herself an undying gratitude for what she had — and an awesome ability to communicate it — we can be thankful that she inspires millions to this day. No matter how old you are, you can learn some critically important life lessons from this brave teenage heroine.