In college, I developed a mysterious illness. I experienced myself as happy, yet in the afternoons I would cry for two hours. Although the obvious interpretation was depression, to me it was all about lunch. Food exhausted me and made me sad. I tried skipping breakfast and lunch, and snacking on cottage cheese and milk chocolate bars. Then carrots.

After many afternoons like this, what philosophical 18-year-old would believe in free will? I was a digestive system, molecules. The next thought was that I would die, dissolve into molecules… while young.

Around this time, I discovered William James (1842-1910), the father of American psychology as a formal discipline. Was my problem ‘psychological’ or ‘physical’? James let me understand that it could be both. Mental phenomena, he explained, had physical roots. He created the first biology-based psychology lab at Harvard University, yet he trusted subjective experience and honoured our capacity for clear thought. I was my digestion and I had choices, too.

The debate about free will is clear on one point: we experience ourselves as choosing. This might be an illusion, but not one that we can function without. When you pick up your arm, you’re picking up your arm. However, during those teary jags, if my arm went up, it didn’t feel like my choice. Mostly, I just lay there. When I was 17, a date slipped me Quaaludes and raped me – the experience was similar. And I had stopped feeling that I had any choice about what I ate.

Yet around 4pm every day, I would rise and do my schoolwork, sometimes with floods of inspiration. I had a perfect string of As that year.

James also had been overcome when young, and felt doomed. For almost three years after receiving his medical degree, he stayed home suffering digestive trouble, poor eyesight, back pain, hallucinations, panic attacks and depression. He was unable to exercise or believe in his own will. But on 30 April 1870, he rose, writing in his diary:

[Y]esterday was a crisis … I finished the first part of Renouvier’s second ‘Essais’ and see no reason why his definition of Free Will – ‘the sustaining of a thought because I choose to when I might have other thoughts’ – need be the definition of an illusion. At any rate, I will assume for the present – until next year – that it is no illusion. My first act of free will shall be to believe in free will.

For him, as for me, the self, or ‘will’, had to be asserted against the weight of uncertainty about our future ability to function. For decades to this day, I tried one diet after another. I tried every antidepressant. I and my symptoms fluctuated, and I didn’t know why or when. But as I read James, I just needed to keep trying things and, most of all, be brave. From him I learned that the truth is elusive – but taking action is mandatory.

Over the years, I turned to this thought whenever I didn’t know whether I was well enough to accept a challenge, if my illness was the danger or the bigger danger was my fear. James almost missed out on his great love, his wife Alice, fearing that he wasn’t sane and sturdy enough to ask anyone to share his fate. ‘The Beast in the Jungle’ (1903), one of his younger brother Henry James’s most famous stories, describes a man too preoccupied with a sense of doom to love.

Just do it. Now it’s a Nike slogan, popular because it’s so useful. James chose to believe love would be a cure. He would credit Alice for his stability during what became an extraordinarily productive life. Although always fighting a volatile disposition and bad eyesight, he was joyful, an eccentric dresser, great conversationalist, and a spontaneous teacher. He created moments for play. Ebullience can be annoying to other people – killjoys who consider it shallow. James thought it was anything but. When his carriage moved slowly on a mountaintop, he would jump out to lighten the burden on the horses. He played tennis, skated, bicycled, rode horses, and climbed mountains.

His life teaches us to stick with the big project – even if we miss our deadlines. In 1878, James signed a contract to write a psychology textbook in two years. The Principles of Psychology, a massive compendium, didn’t appear until 1890. The project weighed heavily on him, but he persisted, revising chapters four or five times over. James cared about his writing style – and was delighted that so many people in his day experienced his textbook chapters as rousing sermons. In one on habit, his sage advice – make resolutions and tell other people so you’ll feel accountable – resonates today.

As he finished this tome, he wrote to Alice: ‘[I]t does give me some comfort to think that I don’t live wholly in projects, aspirations and phrases, but now and then have something done to show for all the fuss.’ If you feel like a dreamer, James is on your side.

It helped that Alice had faith, both in her husband and the Almighty. James, who at various points attended church, understood that faith can be psychologically healthy, and argued in his essay ‘The Will to Believe’ (1896) that we can talk ourselves into it. But he doesn’t seem ever to have believed.

This too inspired me, an atheist: I admire and seek out the devout, and attend services of all kinds. It’s become common now, picking up religious practices as a form of self-care. James invites us to be open to the mysterious, from God to psychic phenomena. We act on ‘insufficient evidence’ in all areas of life, he said.

The let’s-try-it ethos of his free-will formula became a core idea. James belonged to a small group in Cambridge, Massachusetts who developed pragmatism as a uniquely American school. Facing a fractured society after the horrors of the Civil War, the pragmatists told Americans to ditch their certainties, accept constant change, experiment and understand that we judge ‘truth’ by results. Did the idea prove helpful in some consistent way?

Experimentation doesn’t have to mean that we abandon the hope of lasting moral principles, as the post-Civil War pragmatists seemed to urge. But imagine you were a Northerner interested in protecting the Union before the Civil War. Would you have been an abolitionist? How often do we accept a wrong because the cost of fighting it is too high, and the zealots on both sides are hard to trust? James was proud of his two younger brothers who became officers for black regiments while still teenagers. He was also ashamed that he himself didn’t fight. But he didn’t enlist. Biographers blame his father; he blamed himself.

His dilemma has stayed with me. One of my friends, a black evangelical Christian, believes that abortion is today’s slavery, the great wrong the majority can’t see. I don’t agree but I can’t just call her a zealot. I’m a feminist and I listen, hard.

We say it’s harder to listen now – the stakes higher, the conflict more intense. But has it ever been easy? James would have us listen to hone our own arguments, knowing that conflict can speed progress. In an era fascinated with Charles Darwin, James touted the value of competition. ‘Rivalry lies at the very basis of our being, all social improvement being largely due to it … The spectacle of effort is what awakens and sustains our own effort,’ he wrote in 1899. In my own life, I tend to be ashamed when I am competitive or envious – I like James’s idea that it’s normal.

Recently, I received a new diagnosis. It has taken 30 years for scientists to track symptoms such as mine to an immune disorder. My grandmother, who was born in 1900, probably suffered from the same problem. When her face swelled up as a young woman, her doctors pulled out all her teeth. Nobody did that to me! Like millions of people with chronic ailments, I’ve tried strange, embarrassing remedies with mixed success. Yet had I demanded stronger reasons for confidence, I believe my life now would be much smaller.

After all these years, I’m grateful for the scientific progress in my time and its animating philosophy, which James helped to establish.

Four o’clock comes to us all. When you’re well, it comes in the morning. We ‘sustain a thought’ about getting up, even if we’d rather not, and we rise. As a child, I didn’t know my grandmother wore false teeth. I saw her as she chose to be, at breakfast, ebullient and smiling.