For the worst country in the world, Liberia looks lush. All along the long road to Fish Town, the sumptuous rainforest on either side is a comfort, a green bath to soothe the dreadful red dust that is constant and the potholes that cause nose-bleeds, head-bumps and nausea even in this well-cushioned Toyota Land Cruiser belonging to WaterAid. We are scrunched into this car for days, because that's how long it takes to get to Fish Town, only a few hours from Liberia's capital Monrovia if you're a crow, but 36 hours otherwise, because the country has only one decent main road.

To get there, we must loop north, brushing the border with Guinea, before swooping back down to a town that isn't much of a town, the joke goes, and doesn't have much fish. But it's busy these days because NGO 4x4s such as ours are zooming through on their way to help refugees escaping from Ivory Coast, the latest poor sods in this region to be kicked out of their country by war.

We, though, are not zooming towards refugees but towards something far less newsworthy. It is my sixth visit to Liberia. The first was in 2004, six months into the country's first peace in 20 years. Liberia had suffered years of stunningly brutal civil wars, orchestrated largely by Charles Taylor, now on trial in the Hague for war crimes (a man who once sued a journalist for saying he had eaten a human heart, and lost); and by other warlords with names such as General Butt Naked, General Peanut Butter and Devil. And this war's stories were more horrific than most: mass rape; boy soldiers kept going by drugs, looting and raping; parents killed by their own boys; checkpoints made from intestines. Imagine the worst and, if you looked, you'd find it here doubled.

By 2003, when the Economist called Liberia the worst country in the world, it was wrecked. Yet it hadn't always been that way. Founded by freed American slaves in the 19th century, Liberia had had good times. Its ex-slave colonists built graceful mansions, installed themselves as rulers over local tribes and instituted a Liberian English that still has the infectious drawl of the American South. They named their capital after US president James Monroe; they called their currency the dollar; they let the US use them as a listening station in the second world war. Liberians – flying a US-lite flag of stripes and one star – thought they lived in the 51st state, or "Bitty America". But it was a one-way relationship: during battles so terrible that they were called world wars I, II and III, a US warship holding 2,000 marines anchored itself on the horizon and did nothing to help. Only when rebels attacked Monrovia was Taylor persuaded to leave and a UN force brought in.

The receding war left ugly tides. At least 70% of women raped. Nearly the entire population refugees of one sort or another. A huge brain drain. No functioning electricity grid. A decimated healthcare system. And, thanks to the plundering Taylor, a national debt of $4.9bn. In 2004, when I first visited, all Liberia seemed to have was 9,000 UN peacekeepers and some cautious hope.

But the world's worst country has been busy. In 2006, it elected Ellen Johnson Sirleaf to be its president. A Harvard-trained former World Bank economist, Sirleaf is Africa's first female head of state, Ma Ellen to three million or so Liberians and a president with a dizzying to-do list. Eighty-five per cent of Liberians have less than a dollar a day to spend. A dollar goes further in Liberia, but not that far, when rice costs $45 a bag. You can always find a decent Club Beer in Monrovia, but you won't find a post office, electricity grid, sewage treatment, taxes or decent road system. One suburb of the capital is called Red Light, because it used to have a traffic light. It doesn't any more.

How do you fix a ruined country? Start with the money. If you can, get that $4.9bn of debt forgiven. Increase the national budget from $80m a year to $360m. Then figure out how to earn more. Open for business and sell everything you can: oil, gas and mineral rights; timber concessions. Open your ports and improve your roads for all the mining and logging equipment to trundle down. Talk about developing tourism. Invite the Chinese, so that after hours on a road to the remotest part of the country, you'll find young Chinese lads taking a break from building bridges to take each other's photograph, as well as new universities and hospitals with suspiciously Chinese-looking roofs.

All that is basic nation-building. But there is also something that's not on most nation-building lists. Liberians elected a woman who understood that something basic could save millions of dollars, something most people don't want to talk about. Most people, but not Ma Ellen, the only serving head of state to have written in a major newspaper about the need for toilets. That's right. Toilets. Because of that, I request an interview with her; and because I am here with WaterAid and have written a book about toilets, she grants it.

We meet in the foreign ministry, where the president moved after the executive mansion caught fire. Ma Ellen's personal guards, female Indian peacekeepers, stand at the gate like statues. (Someone tells me he saw them beat up rioters one day, then go to church in their saris the next, "looking so sweet and lovely".) Monrovia's mayor is also a woman, as is the director of the port, a crucial position. Sometimes I feel as if I've landed in a Patricia Cornwell novel, where all positions of authority are held by women. It's great.

In her spacious office, impeccably dressed in her trademark African cloths and turban, the president is warm and gracious, despite a stern reputation. I have been warned to stick to the agreed topic of sanitation. Stray off it – to accusations of endemic corruption, nepotism and human rights issues, for example – "and you will see her change in an instant", a Liberian friend tells me.

Most Liberians have grown up in the countryside, where the idea of a bush toilet is second nature. But their proximity to water supplies and homes can prove deadly. Photograph: Aubrey Wade for the Guardian

Sirleaf took a while to understand the place of good sanitation. Like countless Liberians, she grew up on the family farm, where the only toilet was the bush. "It came naturally," she says, when I double-check that the president has just admitted to open defecation – or, as Liberians say, doing poo-poo in the bush. "That was what it was."

Like the six out of seven Liberians who still do the same thing, or the 2.6 billion worldwide who have no toilet, Sirleaf didn't see what was wrong with it. All that forest: what harm can a little poo-poo do? Now she knows better. She knows that diarrhoea – caused largely by people ingesting water or food contaminated by human waste – kills more children worldwide than HIV/Aids, tuberculosis and malaria combined. She knows that even the greenest, widest forest can't prevent faecal particles being tramped into a village on feet and flies and fingers, to be dipped into food and water, to become diarrhoea, dysentery or cholera. She knows, as an economist should, that good sanitation could reap millions of dollars a year in savings. India, where two-thirds of the population are toiletless, loses $58bn a year in wages and medical bills to the 50 diseases that can travel in human excrement. Half the hospital beds in sub-Saharan Africa are filled with people suffering the consequences of bad sanitation. But, of course, the president sees endless statistics. Only when she looked into why so many Liberian women were dying in childbirth, and why children were dying of something as banal as the squits, did she realise "there is a relationship with water and sanitation. I needed to understand why that was so, and partly it's because people don't have access to clean water. That was an eye-opener for us."

Ma Ellen is amazing, but she is a politician. She is fluent in euphemism. When she says "clean water", she really means "water without human excrement in it". That's what "clean water" means, because that is what dirty water is dirtied with.

At the end of a long, red road, a bone-shaking hour's ride from Fish Town, we arrive at Jaytoken, an ordinary village like thousands of others, with huts grouped around a green football pitch and surrounded by that ever-so-green forest. Women do chores; men are at the farm or the illicit gold-mine nearby. The closest clinic is a four-hour walk away. The road is so bad only motorbikes or 4x4s can negotiate it in the dry season; hardly anything can pass in the rains. People walk and walk and walk. The only fat bellies here are the ones filled with worms. Why? Because of the creek.

The creek is everything. It carried dead bodies in times of war. It still carries animal carcasses. Boas swim in it. It carries the excrement of upstream villagers who use it as a toilet. It provides drinking and washing water. And it brings death – it is the water into which hopeful mothers with diarrhoea-afflicted children mix oral rehydration salts, dispensed for free by that clinic four hours away, without boiling it. I don't know why they do that – they have had countless hygiene lessons.

Rev Charles Saylee and his wife Dorris, whose infant daughter died after a bout of diarrhoea. She took three days to die from what, in the western world, is considered a relatively harmless stomach bug. Photograph: Aubrey Wade for the Guardian

They tell me their dirty water causes "running stomach" and that running stomach sometimes causes death, such as that of Marie Saylee, nine months old, who got sick last November. I ask her father, Pastor Saylee, why she wasn't taken to the clinic. There was no time, he says. He goes to fetch the country medicine he would have given her, had she been older. It is a leaf called wudirrubu, or "goat-eat leaf", because goats eat it. You pound it, mix it with creek water – again, unboiled – and drink it. Marie's mother gave her pepper soup, coconut milk, clean water from the hand-pump. Nothing worked. Marie took three days to die from something most of us consider a stomach bug.

The people of Jaytoken, like people in countless other villages, knew that creek water was deadly water. And still they didn't boil it. They had soap for sale cheaply in the local shop, along with affordable water-purification sachets, but nobody bought them. They could build their own houses; they crafted chairs and lovely bamboo window shutters – but they would not build latrines. Like the president, going for poo-poo 60 years ago, they didn't see the necessity. They had other things to think about, such as not having a decent road or clinic or money. Sanitation was a luxury. So along came WaterAid, trying to reshuffle those needs into a list that puts sanitation near the top. Jaytoken's green fields are atop rock, so they brought rock-breaking equipment to sink water pumps. But the villagers kept going to the goal-pole latrine in the bush – so-called because it is formed of a perch that looks like a goal – so WaterAid brought in a Liberian NGO to perform a process known as community-led total sanitation (CLTS). That jargon hides a fascinating concept: that people are stubborn and so must be shocked out of their wrong behaviour. The NGO does this with tricks. By dipping a hair they say has been dipped in shit into a glass of water and then asking people to drink it. No? How is that different from the water they drink every day? Or by putting food next to a piece of excrement and watching the flies jump from one to the other. Are they different flies? No? By that point, the penny is supposed to have dropped. "The basic assumption," says the CLTS handbook, "is that no one can remain unmoved once they have learned that they are ingesting other people's shit."

Liberians don't use that word. "Poo-poo" is bad enough. But not bad enough for the president to be shy about it when I ask what language she uses to talk about sanitation. "I say poo-poo," she says. "Of course. If you tell people 'defecate', they won't understand."

CLTS is wildly popular in the world of poo-poo activists. It has been hugely successful in many parts of the world. When it works, it works dramatically. People rush off to build latrines, then they clean up the rest of their villages. They are encouraged with prizes and – in India – awards handed out by the president and covered on national TV. WaterAid is one of dozens of NGOs currently using the technique.

But it doesn't always work. The trouble with sanitation is that it involves human nature. People don't usually respond well to health messages or nagging – many doctors smoke when they know they shouldn't, for example. At Jaytoken school, the blackboards are covered with appropriate hygiene messages, written especially for our visit. A young woman named Grace puts up her hand when I ask if anyone has ever been bitten by a snake while going to the latrine. She is a 24-year-old in a primary school, because her school years were swallowed by war. She was bitten by a snake because the school was built by a Liberian charity that gave up before providing toilets. Snake bites are one risk; sexual assault is another. None of the women of Jaytoken admits to being raped, but it is endemic, and using latrines in the bush leaves them vulnerable. Water may be life, goes the slogan, but a decent toilet is dignity.

Villagers in Nyonken, Liberia, collect water from the river for cooking, washing and drinking, even though they know human waste from villages upstream may have contaminated it. Photograph: Aubrey Wade for the Guardian

Dignity doesn't get the attention that clean water does, though. The people of Jaytoken and nearby Nyonken – a three-hour walk away – are proud of the new pumps provided by WaterAid. But, like seven out of 10 other Liberians, they still haven't built latrines. Far too many NGOs rush to provide a clean water supply without bothering to install sanitation along with it. If there is a better method for polluting a clean water supply than having little fingers covered with faecal particles, I don't know what it is.

I ask the president about this disparity. Sanitation makes economic sense, after all. CLTS, for example, is cheap – no expensive concrete latrines, no sewerage systems, just some clever persuaders changing people's hearts and minds.

"The problem is," she answers, "these public services don't have a high profile. People want to see their footprint – a building that everyone can see, or a road. No one pays attention to the three-room latrine in the back yard. There has to be a whole change of consciousness."

And not only by donors. In the welcome meetings, villager after villager stands up with a petition. Thank you for the water, they say, but give us more. Give us roads. Give us a clinic. They don't ask for latrines. A man from the ministry of works expresses what I'm thinking: "You can build your houses. Why don't you build latrines? If a hinge falls off a door, will you expect an NGO to come and fix it?"

The president would be unimpressed, but unsurprised. "People say they want health clinics," she says, "but they don't ask for sanitation. They say their children get malaria or dysentery, but they don't ask for sanitation. We have to bring to their consciousness that sanitation is linked to health."

On the way back to Monrovia, with the roof of the truck now holding a live chicken that the villagers of Nyonken gave us to honour us (and which ends up in a pot in a Fish Town restaurant), we pass more 4x4s zooming towards the border and the refugees. I feel frustrated. In Monrovia, ministers and NGOs hold a weekly crisis meeting about refugees, but not about the 18% of Liberians who die because they have no toilets or clean water.

Towards the end of our interview, I ask the president why that is. We had followed in her footsteps to Fish Town because she had also gone to see the state of the Ivorian refugees, most of them welcomed by Liberians who had to think back only a few years to a time when they were themselves refugees. Ma Ellen is too polite to shrug, but her words do. "The humanitarian system responds to these things that get sensational," she says. "They want to be seen as responsive. The ordinary village, that no one is taking care of, that doesn't come to mind." And with that she takes her leave, to get back to the job of fixing her country, one latrine at a time.