JK Rowling has some inspirational advice for graduating students – or for anyone in this universe, really. Her new book, Very Good Lives: The Fringe Benefits of Failure and the Importance of Imagination, out on 14 April, is her 2008 commencement speech at Harvard University, published by Little, Brown. Proceeds from sales will be donated to Lumos, a charity for disadvantaged children founded by Rowling, and to a financial aid programme at Harvard. Some of her wisdom from that speech, for those of you who weren’t in the Harvard audience, is collected below.

How to be good ... the cover of Very Good Lives.

Rowling, who came from a family where her imagination was seen as “an amusing personal quirk that would never pay a mortgage, or secure a pension”, struggled considerably before becoming one of the world’s most successful authors: seven years after graduating, “I had failed on an epic scale. An exceptionally short-lived marriage had imploded, and I was jobless, a lone parent, and as poor as it is possible to be in modern Britain, without being homeless.” Only last week, she tweeted about the rejections she has received in her career – even under the pen name Robert Galbraith which she adopted, after the succcess of the Harry Potter novels, for crime fiction.

The writer based her speech – the most viewed commencement speech on Harvard’s website – on “failure and imagination”. Delivered to some of the world’s most elite students, her words went beyond the get-ahead cliches of careers advice. Here are 10 of our favourite quotes:

On the benefits of failure

There is an expiry date on blaming your parents for steering you in the wrong direction; the moment you are old enough to take the wheel, responsibility lies with you.

I am not dull enough to suppose that because you are young, gifted and well-educated, you have never known hardship or heartbreak. Talent and intelligence never yet inoculated anyone against the caprice of the Fates.

I am not going to stand here and tell you that failure is fun. That period of my life was a dark one, and I had no idea that there was going to be what the press has since represented as a kind of fairy tale resolution.

Failure meant a stripping away of the inessential. I stopped pretending to myself that I was anything other than what I was, and began to direct all my energy into finishing the only work that mattered to me. Had I really succeeded at anything else, I might never have found the determination to succeed in the one arena I believed I truly belonged.

On the power of imagination and empathy

We do not need magic to change the world, we carry all the power we need inside ourselves already: we have the power to imagine better.

Many prefer not to exercise their imaginations at all. They choose to remain comfortably within the bounds of their own experience, never troubling to wonder how it would feel to have been born other than they are.

Those who choose not to empathise enable real monsters. For without ever committing an act of outright evil ourselves, we collude with it, through our own apathy.

Every day of my working week in my early 20s I was reminded how incredibly fortunate I was, to live in a country with a democratically elected government, where legal representation and a public trial were the rights of everyone.

One of the many things I learned at the end of that Classics corridor down which I ventured at the age of 18, in search of something I could not then define, was this, written by the Greek author Plutarch: ‘What we achieve inwardly will change outer reality.’ That is an astonishing statement and yet proven a thousand times every day of our lives. It expresses, in part, our inescapable connection with the outside world, the fact that we touch other people’s lives simply by existing.

As is a tale, so is life: not how long it is, but how good it is, is what matters.