If you want to get anywhere in the world, make your enemy your friend.

Nelson Mandela learned that at Robben Island prison, where he spent 18 years starting in 1964. He and his friends slept on concrete floors, and condensation from the tin roof dripped on them. They were allowed no underwear and only sandals, even in winter.

Mandela was permitted one 30-minute visit every six months, and one letter of no more than 500 words per month, in or out, and they were often heavily censored. It would be 23 years before he touched his wife, in a closely monitored embrace. It was a decade before he was allowed to see one of his daughters, two decades before he was able to see a second, and 27 years before he could see his other children, upon his release from prison.

He and the other prisoners were permitted no reading material, not even a Bible. Mandela, a lawyer, needed books. He and his friends wanted newspapers, a radio, but access to news was prohibited.

"We had to make friends with the warders," Mandela said. The prison guards were young, white, poorly educated men, primed to hate blacks and to see Mandela and his friends as "terrorists." (A view widely held: It was only in 2008 that legislation by then-Rep. Howard Berman of California removed Mandela and his contemporaries from the United States' terrorism watch lists - even though Mandela had received the Congressional Gold Medal 10 years earlier.)

Some of the warders were vicious sadists. Johnson Mlambo, who was jailed in 1963, was buried up to his neck in soil and then forced to open his mouth as a guard urinated into it. Others were locked into cells with criminals who would gang-rape them. Mandela was not subjected to physical torture, but all the prisoners experienced psychological torment.

"We had to befriend the most hostile warders," Mandela said, "because they were the ones who would be least expected to smuggle."

Once a book or newspaper was smuggled in, it would be copied in tiny, crowded writing, sealed in precious plastic, and concealed. The words would be memorized.

I was one of many journalists who were astonished by an initial interview with Mandela in which he would quote back to us, line for line, words we had once written or broadcast. He had an extraordinary memory for people and detail.

Mandela also created situations for others to make friends of their enemies. As a political journalist in South Africa and former antiapartheid activist, I was vocal in my criticism of Mandela's successor as president, Thabo Mbeki, and his failure to get lifesaving medications to those with HIV, which infects an estimated 6.1 million South Africans. I clashed bitterly with former Health Minister Nkosazana Dlamini-Zuma, now the head of the African Union.

So I was aghast when, at one of Mandela's birthday celebrations, he seated me directly opposite Dlamini-Zuma. There was little option other than to channel Mandela: I swallowed my ego and began pleasantly chatting with her. As the evening wore on, laughter came from our table, Dlamini-Zuma and I will never be friends, but we never again criticized each other publicly. Mandela taught us the most essential lesson of all: to respect the humanity in another.

In a world where many of us ignore those we consider lesser, Mandela would stop, extend his hand, and chat sincerely with all kinds of people. He loathed PR, and he genuinely cared about people. It wasn't important to him that his goodness be recorded; it was important to him to do good. Every person felt he truly valued him or her; every interaction with Mandela felt deeply personal.

He embodied the meaning of the Hindu greeting namaste - "the god in me honors the god in you" - or the African idea of ubuntu, which is too often disregarded in Africa: A person is a person because of others. In other words, every person met, every interaction experienced, marks us for better or worse.

Mandela's lessons are: Bury your ego, make friends of your enemies, and be kind. It costs little, and the rewards are great. Oh, yes, and if the music is playing, dance.

Charlene Smith is the author of "Mandela: In Celebration of a Great Life" She is an authorized biographer of Nelson Mandela who had a friendship with him for 23 years. Born in South Africa and a resident of Cambridge, Mass., she has written four books about Mandela and helped produce four television documentaries on him. Her website is www.charlenesmithwriter.com.