Tea has always been there in my life. When I was very young – about three or four – I had a silver cup with a top that prevented the liquid from spilling out. One of my first memories is of drinking tea from this cup, the metal pressed hard against my lips. We love the old things in our lives, the plates, spoons, cups of our infancy. As Auden says, when he was a boy he had a pumping engine and thought it every bit as beautiful as his lover. I had a pumping engine, too, operated with a tiny methylated spirits burner. But I also had my tea cup, and we had tea parties.

I suppose any boy who has a tea cup and has tea parties is going to grow up liking tea, and perhaps even writing about it. Lin Yutang, the essayist and inventor of the Chinese typewriter, famously asked: what is patriotism but the love of the good things one ate in childhood? Patriotism is certainly more than that, but there is an interesting truth in this observation. The things that we are brought up with can be very important in determining our sense of who we are. For this reason, although tea is not at the heart of being British, it is somewhere not far away, in that ill-defined collection of practices and attitudes that make up our identity.

At home, tea was served with great regularity. The morning started with tea, the pot and teacups set out on a large Indian brass tray. Tea was then served with breakfast, at 10 o'clock, and immediately after lunch. More tea was drunk at about 4 o'clock, and then again after dinner. We did not drink coffee, and we never had wine. Nobody had wine in those days, in Bulawayo (now in Zimbabwe), where we lived, although there was a wealthy cattle dealer who lived on a hill and who entertained his friends with champagne – a breathtakingly exotic thing to do – in the dreary surroundings of the local cinema. That was about as high as life got then.

We put sugar in our tea. For most of my boyhood I took three spoons, and it did not occur to me that this not only ruined the tea but also teeth. Of course there was no fluoride added to the water and everyone had fillings anyway, but I wonder how many of them came from sickly sweet tea. To make matters worse, we occasionally added condensed milk.

The tea itself was pretty standard black tea, grown in the eastern districts of what was then Southern Rhodesia. Occasionally somebody served what was described as China tea, but that was regarded as a little bit pretentious, or even decadent. Ordinary tea, served in functional teacups, was what had won the second world war and kept the Empire going. Why depart from all that?

The definitive images, of course, demonstrating the heroic role played by tea in the second world war were those photographs of the air-raid wardens and firemen during the Blitz drinking tea from mugs in the aftermath of bombing raids. Buildings lay in ruins, rubble filled the streets – but the spirit of the Londoners was above all that, and they drank tea to show that they were not going to be cowed by the bombers. Indeed, there were people whose job it was to make tea for the firefighters and the wardens; these tea ladies were brave people, heroines really, and the tea usually got through, no matter what was happening.

It is interesting to read the memoirs of people caught up in those events. They frequently mention how important their mug of tea was, how it calmed and reassured them. Tea represented normality; it represented the continuity of ordinary life in the face of appalling and frightening odds. Even today, the response of many people to a difficult situation is to make tea. To say "I'll put the kettle on" is not necessarily going to solve any problems, but is a comforting thing to say. And if there's nothing else one can say or do, to make tea is at least to do something. Indeed, making tea is vaguely therapeutic; the mind is taken off the crisis and it gives one time to think about things and set them in perspective.

There is also a sense in which making tea for another is a communicative business. If I make a cup of tea for you, I am doing something that we both see as bringing us together. Making tea is a social act. That sounds like pretentious theorising, but it really is true. There surely cannot be a culture in the world where the act of sitting down to eat with another does not mean something in relationship terms. The same can be said for giving somebody something to drink, whether it is buying another a drink in the pub or making him or her a cup of tea. By drinking tea together, particularly where there is at least some level of ritual involved, we share something between us and become closer, even if only for that short time.

Such subtleties, of course, did not mean much to me in the days of those highly sweetened cups of tea. It is only after I stopped taking sugar in my tea that I began to appreciate that there was so much to tea. The abandonment of sugar came, I think, in my early 20s. I had then encountered Earl Grey tea and the like, and I had started to take an interest in china. Before that I had not had the slightest interest in the cup or mug that contained the tea; now I began to understand that tea in fine china cups somehow seemed to taste better. It still had sugar, though, until I decided that the time had come to abandon it. I do not remember why I decided to do this – it was probably after reading that in general we ate too much sugar – but for whatever reason sugar was suddenly dropped.

It took about 10 days, if that. At first, unsweetened tea tasted uncomfortably bitter. Then it started to taste more palatable, and finally it tasted of tea rather than sugar. After that there was no going back, and within a very short time I had the zeal of the convert. "How can you possibly put sugar in your tea?" is a wonderfully superior question to ask of others. That one did the same thing oneself for 20 years or so is beside the point.

Of course even devoted tea drinkers have a dalliance with coffee. In my student days in Edinburgh I drank as much coffee as anybody else, even if I did not give up tea. Those were the days before real coffee had reached studentdom, and we drank instant coffee, a substance that evidently has some connection with actual coffee, although surely very distant. This was prepared in mugs, with dirty spoons, and had cold milk added to it. Students who lived in flats or digs without a fridge – and there were many – often added slightly sour milk to their coffee but did not notice, or did not care. How unsophisticated we were – those were the days when one took a bottle of Lutomer Riesling to a party, or Blue Nun if the party was being given by a girl. A really special occasion might merit a bottle of Mateus Rosé which could, after consumption, be turned into a candlestick.

Coffee, although a temptation, never cut the umbilical cord that linked me to tea. Even after the coffee-bar revolution, which I greeted with enthusiasm, and still do, I never lost my attachment to tea. And now that I was no longer ruining tea with sugar, I could begin to take an interest in different sorts of tea. That was part, I suppose, of the business of developing adult tastes. When we are young, the idea of choice or refinement seems pointless – even self-indulgent. But as we go through life, most of us find that we want to explore things that are slightly more complex.

The first thing to go was tea bags. I was not brought up on these and so I viewed them with a certain suspicion when I first encountered them. The idea of a tea bag seemed reasonable enough, of course, and there was a modern, convenient ring to them, in the same way as television dinners seemed to be the last word in modernity. But then the bland nature of tea sold in tea bags began to become obvious, and I rebelled.

Alexander McCall Smith takes tea at home with a friend. Photograph: Murdo MacLeod

It was not easy; families can be split on the subject of tea bags. My wife and I were adamant that we would not use them, even when we were staying in houses where tea bags were all that was available. We did not openly criticise our hostess's tea arrangements, but we began to travel with supplies of loose-leaf tea in our suitcases, along with a teapot. We also acquired a small heating element that could be put into the teapot to bring the water to the boil before the tea was added. Taking private supplies in this way is a big step, as it constitutes a judgment on your hostess – a judgment of inadequacy in a crucial department.

We always take this equipment to hotels, especially in the United States, where tea-making has never fully recovered from the trauma of the Boston Tea Party. If you stay in an American hotel, you are more or less guaranteed not to be able to get a good cup of tea. I know that this is a major accusation to make against a whole culture, but it is, regrettably, quite true. Certainly you will find tea (in the form of tea bags) in your room, but how do you make it? The answer is that they expect you to make it in the coffee maker.

Now the problem with that is that if there are two flavours in this world that cannot – in any circumstances – be combined, it is tea and coffee. To make tea in a container that has been tainted with coffee is to ensure that the resultant tea is undrinkable. The flavour of coffee lingers in a vessel long after the last cup was brewed, and it is impossible to use that vessel for tea-making no matter how much it is washed. Try it. Put coffee in a vacuum flask and then, after washing it out thoroughly, try to use it for tea.

I am not one to criticise the United States, which has many fine qualities and has undoubtedly conferred many benefits on humanity. But, subject to a few exceptions, they do not do a particularly good cup of tea, as any attempt to obtain tea at an American airport will confirm. The exceptions are the really grand hotels, particularly those that are old-fashioned. In New York, the Algonquin Hotel, scene of the bons mots of Dorothy Parker and her circle, does a very good afternoon tea. The Russian Tea Room, next to the Carnegie Hall, is also a good place for the parched tea drinker. Elsewhere in New York, as in other American cities, it can be difficult to get a cup of tea.

The American South is more of a tea-drinking culture. I spent six months in Dallas some years ago and had a major shock when I was offered tea, accepted, and was given a beer-glass full of ice and a tea-looking liquid. My surprise turned to delight, as I realised that this was another case of the people knowing exactly how to do things in a way that suited local conditions. It is too warm in places like Dallas, Texas or Mobile, Alabama – two places where I have drunk a lot of iced tea – to drink too much hot tea, and iced tea is perfect.

My interest in tea led not only to my trying new varieties, but also to several visits to tea estates in India and Sri Lanka. Indian tea gardens can be particularly enchanting if they are old-fashioned and are still using old machinery. I went to one in the Western Ghats where the machinery – those great mills and shaking trays – all bore the stamp of British manufacture. It seemed ancient, and had a distinctly Heath Robinson look to it, but it was real machinery, complete with long drive belts and all the things that must now have been phased out of existence. Modern tea machinery comes from China, I believe, and I suspect that it does not have quite the same character.

Naturally, when I came to write my Botswana novels, the No 1 Ladies' Detective Agency series, tea played a part in the narrative, as does cake. Indeed, I have sometimes described these, jokingly, as tea and cake novels, only to have my description quoted back at me. Mma Ramotswe, the owner and begetter of a small detective agency in Gaborone, drinks tea with her assistant, Grace Makutsi. In the first book I decided to have Mma Ramotswe drink something called redbush or rooibos tea. Now this, strictly speaking, is not real tea, as tea experts will be quick to point out. Neither is camomile tea, peppermint tea, or any of the other infusions that have become so popular. I understand the reason for the distinction being made, but I think that we should accept that tea has now become a generic word, encompassing brews that are nothing to do with the tea plant.

Mma Ramotswe drinks both redbush and ordinary tea. She does so at regular intervals of the day, starting when she gets up and walks around her garden in the morning, and ending with a final cup at night. During the day, when we see her sitting in the office with her assistant, the redoubtable Mma Makutsi, they are often drinking tea. These scenes have caused readers to speculate as to the significance of tea in my novels. Some assume that the tea-drinking has some symbolic meaning; in fact, it is merely a novelist's device for ensuring a break in between other scenes. I suppose, if pressed, I might come up with an explanation in terms of its calming effect; it is no doubt true that tea-drinking is a calming thing to read about, but that is not necessarily why I write about it. One can always do the right thing for the wrong reason.

Tea has begun to play a role in my Corduroy Mansions series, the second volume of which I am now writing. Its role in the books began with a visit to a Pimlico delicatessen when I was looking at the setting for the series. There in the doorway, handing out sample cups of tea, was Henrietta Lovell, the owner of a small tea-importing firm called the Rare Tea Company. We struck up a tea-related conversation and I later contacted her to ask whether she would mind if she made a cameo appearance in the first volume of Corduroy Mansions. She agreed. Later she drew my attention to the fact that she wanted to start importing tea from a tea estate in Malawi. I discussed this with her – anything that can help that lovely but rather struggling country was a good idea, as far as I am concerned. I invented a name for the tea – Lost Malawi Tea – and agreed to write a series of tea stories to be put into the canisters of this tea. The tea has now been launched, and the first four tea stories have been printed and tucked into the tins. If characters in Corduroy Mansions now start to drink this tea – and they have – then I hope I can be forgiven. I make nothing from it and the tea, which is fair-traded, helps people who do not have much in this world (in the material sense).

Tea, for me, is one of the great subjects. It is a romantic trade, it does not pollute excessively, it has all sorts of health benefits, it calms and wakes you up at the same time. It promotes conversation. You can give it to the vicar when he calls – if vicars still call – and you can give it to the builders when they come to knock down your wall. Builders still take sugar, but then I'm sure they need it.

Tea can be drunk by everyone. Pilots high in the sky drink tea as they fly across oceans. Captains on the bridge of the humblest vessel drink it as they plough slowly through the waves. Submariners drink it as they sail under those very waves. A person who is troubled in heart can drink tea and for a moment feel happier about life. A person who is happy with his lot can drink it and perhaps think about those who are not quite so happy. Members of Parliament may drink it – at our expense – and not feel too guilty. Policemen drink it – as the Ahlbergs point out in the story of the cops of London town – and so do robbers. I have seen a horse who loved to drink it from a cup. Dogs like it, too.

I must now go and put the kettle on.

Mma Ramotswe's Cookbook (Polygon, £18.99), written by Stuart Brown with a foreword and extracts from Alexander McCall Smith, is out now