A day or two here and you'll be humming 'Circle of Life'

It's said to be one of the world's most sustainable economies. Richard Johnson visited two resorts in Costa Rica that try to practise the eco ethos

At Puerto Jiminez airport, in the Costa Rican rainforest, a customs officer pushes a fresh, green coconut into my hand.

No tough questions about "the nature of my business" in his country – just advice. The milk in my coconut, he says, is pure enough to be used as plasma in an emergency situation, and will cure me of everything from club foot to flatulence. The Costa Ricans are No 1 on the Happy Planet Index – even their customs officers like a laugh.

But the Happy Planet Index is about more than a sense of humour. It ranks countries according to their ecological footprint – and Costa Rica is one of the most sustainable countries in the world. It follows a development model that tries to deliver "good lives that don't cost the Earth", and when the customs officer drops the empty coconut into the recycling, he's happy to know that it will end up as matting or insulation. He's clearly "on-message".

The airport at Puerto Jiminez is the gateway to what National Geographic magazine calls "one of the most biologically intense places on earth" – Costa Rica's Osa Peninsula. Because of the abundant rainfall, and the short dry season, it is ridiculously green. Apart from the fig trees, and the scarlet macaws flying in pairs, it could be the South Downs. At the end of a single-track road, fit only for a donkey, lies 1,000 acres of lowland tropical rainforest – the Lapa Rios nature reserve.

The Lapa Rios Ecolodge is one of the top resorts in Central America. But maybe "resort" is a little misleading. The 16 private bungalows don't have a chocolate on the pillow – summer temperatures reach 95F (35C) – or air conditioning. To save energy, there's no television, telephone or tea/coffee facilities in your room and there's only one power point to recharge your mobile and computer.

The Ecolodge ideal takes some getting used to. But not as much as the noise of the rainforest. The howler monkeys are the loudest of the land animals and, once the wall of darkness descends, they're also the most terrifying. I was in an isolated cabin, and all that protected "them" from "me" was a thin net gauze. Whenever I turned on the lights – ugly, blue, low-wattage lights – the mosquitoes came. So I used a torch. On the first night, when I switched on my torch, a huge cockroach scuttled across the floor. I'm not proud to admit, I trod on it.

Everything looked better in the morning, as I showered on my balcony, and viewed the magnificent rainforest. A hike made sense of it all – it made me feel like a traveller, not a tourist. I found a tree that was 300 years old, and shades of blue and green I never knew existed. I even saw a howler monkey. The "terrifying" creature was actually small, furry and cute. By the time I returned to Lapa Rios, I was getting in touch with my own personal rainforest.

From the explanatory paragraphs above the water-free urinals, to the daily tours to the lodge's biodigester, Lapa Rios sells its sustainability message very successfully. The kitchen waste used to be turned into compost in a wormery – until the pigs ate the worms. Now the pigs eat the kitchen waste, too, and turn it into their own waste, which is then fed into a biodigester and turned into methane. The team want to make methane, but there's not enough kitchen waste – the food is too good.

This is a surprise, for the chefs aren't professionally trained. They are farmers and maintenance men, recruited from the community. Not normally something you would shout about, but employing locals makes Lapa Rios more sustainable. They still can't find local fishermen to provide a regular catch, so they are forced to bring the fish from San José – frozen. But everything else, from the chayote to the yucca, is resolutely local.

By day three I had totally "got it". Lapa Rios heated my water with solar panels, and provided me with all the biodegradable shampoo I needed, but I still had responsibilities. The Earth still needed protecting. I was on holiday, but I separated out my waste and refilled my water bottle. And I started to enjoy a different way of being. I would lie in my hammock and watch birds. By the third night, I was ashamed for treading on that cockroach. And I found myself humming "Circle of Life".

Every night they laid on entertainment. Sustainable entertainment. It was either a local artisan selling home-made soaps and shampoos, or one of the hotel guides, cataloguing all the local flora and fauna. There were slides of everything from the Jesus Christ lizard (which walks on water) to the Fer de Lance snake (with a poison that turns human tissue into soup in minutes). It was enough to guarantee that, by the next morning, the guests all switched from short to long trousers.

Guests do more than pay lip service to sustainability. They plan their holidays around it. Many are under 40, university-educated and self-employed. They are yuppies-plus – yuppies with leg room. And, according to the figures, they're not alone. The latest data suggests there are now 50 to 60 million people out there who want to travel guilt free. Which is good news – the idea of sustainability is finally sustainable.

And the market for sustainable tourism is growing. To judge by the reservations book, Finca Rosa Blanca has found a market, too. The "resort" (see above), in the central Highlands of Costa Rica, is less isolated than Lapa Rios and overlooks the capital of San José. But with tours to the waterfalls, volcanoes and misty cloud forests that surround the plantation, the Finca Rosa Blanca message is clear – tread lightly on the planet.

But that doesn't mean you can't eat well while you're doing it. They say you don't need a time check in Costa Rica – you set your watch by the arrival of the rice and beans. Rice and beans are the national dish, and if they've been fried in oil and mixed with onions, it's breakfast. If they're served with fried plantains, it's lunch. And if they arrive with meat and a small salad, it's dinner. But at Finca Rosa Blanca, the chef is a bit more imaginative than that.

He offers guests a tour of the market in San José. The road from Finca Rosa Blanca snakes down through the suburbs, where people lock themselves away behind heavy metal grilles. It's only 20 kilometres (12 miles), but after the calm of the plantation it's a shock to the system. In the noise of the market, vendors sell horchata, a cornmeal drink flavoured with cinnamon, and linaza, a restorative linseed drink used to cure indigestion – probably caused by chan, which has the quality of mucus.

To a European tourist, the drink feels very different. And so does the food. Whether it's the zapotes, oversized avocados with bright red pulp, or the guanabanas, the green football-sized melons with fibrous flesh, the fruit and vegetables in Costa Rica have a Willy Wonka quality about them. The country's native cuisine can't really lay claim to many cooking techniques, but it can offer some of the most exciting ingredients on the planet.

The most popular tour at Finca Rosa Blanca, however, is to the coffee plantation. The two most important species of coffee are the delicate arabica and the thumping great robusta. But in Costa Rica, they only grow arabica. They want to get a reputation for the good stuff, so the government has made it illegal to sell anything else. But even though their shade-grown, organic arabica is just about as good as coffee gets, the Finca still struggles to make a profit. And if a company isn't profitable, it isn't sustainable.

The problem is that the plantation doesn't produce coffee in large enough quantities – and the harvesting is too labour-intensive. Most plantations use machines to harvest the berries but at Finca Rosa Blanca they use local men (thereby making the plantation more sustainable) to pick the berries by hand. It's costly. So it's just as well that Leo Vernari, the plantation manager, came up with the idea of running coffee tours to bring in extra funds.

Finca Rosa Blanca doesn't look like a traditional coffee plantation. There are trees dotted all over the valley, and plants growing everywhere – Leo calls it "organised chaos". But it's like that for a reason. The high walls of grass hold on to the soil's nutrients in the rainy season. And the tall banana palms provide cover to lower the temperature and prolong the beans' ripening process. The result is a sweeter, richer coffee (as the Finca's guests can testify at breakfast, lunch and dinner).

Sustainability is a real selling point at both Lapa Rios and Finca Rosa Blanca. But it's not just for those who are already committed to the cause – we can all benefit from the rosy glow that comes from Taking Nothing but Pictures, Leaving Nothing but Footprints, and Wasting Nothing but Time.

But one small thing. However sustainable bamboo might be, it still makes lousy-looking furniture. And biodegradable body wash sucks. For me, the consciousness-raising must carry on.

Compact Facts

How to get there

Richard Johnson visited Costa Rica as a guest of Cayuga Sustainable Hospitality (cayugaonline.com). He stayed at Lapa Rios Ecolodge & Wildlife Reserve, Osa Peninsula (laparios.com), which offers bungalows from $270 (£165) per night, and Finca Rosa Blanca Coffee Plantation and Inn, Santa Barbara, Heredia (fincarosablanca .com), which offers rooms, suites and villas from $250 (£152) per night.