History can help us understand the forces that have shaped the modern world. But it can also be distorted and manipulated. In an essay taken from her recent book, The Uses and Abuses of History, Margaret MacMillan, Warden of St Antony's College, argues for the importance of her discipline, and against its misuse.

On the evening of 11 September 2001, the American writer Susan Jacoby overheard two men talking in a New York bar. 'This is just like Pearl Harbor', one said. 'What is Pearl Harbor?' the other asked. 'That was when the Vietnamese dropped bombs in a harbour, and it started the Vietnam War', the first man replied.

Does it matter that they got it so wrong? I would argue that it does, that a citizenry that has so little knowledge of the past cannot begin to put the present into context, can too easily be fed stories by those who claim to speak with the knowledge of history and its lessons. History is called in, as we have seen, to strengthen group solidarity, often at the expense of the individual, to justify treating others badly, and to bolster arguments for particular policies and courses of action. Knowledge of the past helps us to challenge dogmatic statements and sweeping generalisations. It helps us all think more clearly.

If those two bewildered men in the bar had known about Pearl Harbor, they would have understood that the attack on the World Trade Center was not the same as Japan attacking the United States in 1941. That was a war between two states; this was an attack of terrorism. That in turn suggested that the tactics and strategy would have to be different from before. Although many, including the administration of President George W Bush, talked about a war on terror, the analogy was misleading. Wars are made on enemies, not on ideas; wars have defined goals - usually forcing the enemy to capitulate - but a war on terror has no clearly defined end. Nor was the attack on the World Trade Center anything like Vietnam. There the United States was carrying the war to the enemy's country, and, again, it had a solid enemy in North Vietnam and its southern allies.

In the aftermath of 11 September, when Americans were shocked, angry and frightened, it was crucial that they and their leaders be able to think clearly. Who, to begin with, was the enemy? Here history was helpful because it cast light not only on al-Qaeda and its goals but also on the reasons for its anger at the West. History was also there to remind Americans of how their country tended to behave in the world and in the face of threats. Those reminders were largely ignored by the US administration as it prepared for war on first Afghanistan and then Iraq.

A year after the attack on the World Trade Center, Paul Schroeder, one of the most thoughtful of the United States' historians of foreign affairs, wrote an article, 'What Has Happened Since 9/11? Not Much, and Not for the Better', in which he urged Americans to put what had happened in a larger historical and global context. Yes, he said, the attack had been frightful, but it had not done long-term damage to the United States. True, the terrorist threat remained a serious one, but it was not as great as those suffered by other states in the present and in the past. Yet the Bush administration was using 11 September to claim the right for the United States to decide whom to attack when it pleased without consulting its allies or world bodies such as the United Nations.

'It is hard to grasp and impossible to exaggerate', Schroeder wrote, 'how novel, sweeping, dangerous, and subversive of world order and peace this new doctrine is. It violates the two foundation stones of the international system developed over the last five centuries: the principle of the independence, juridical equality, and coordinate status of its component units (now almost entirely states), and its equally vital counter principle, the need and requirement for such independent units to form and join associations for common purposes and to follow recognised norms and practices, especially in seeking peace and security.' The United States, moreover, was abandoning its own history of working with others to uphold a world order and, in its invasion and occupation of Iraq, its long history of opposition to imperialism. Worse, as Abu Ghraib and Guantánamo would show, it was going to undermine and compromise its own deep respect for the law.

History, by giving context and examples, helps when it comes to thinking about the present world. It aids in formulating questions, and without good questions, it is difficult to begin to think in a coherent way at all. Knowledge of history suggests what sort of information might be needed to answer those questions. Experience teaches how to assess that information.

As they look at the past, historians learn to behave rather like the examining magistrate in the French judicial system. What happened and why? the historian asks. History demands that we treat evidence seriously, especially when that evidence contradicts assumptions we have already made. Are the witnesses telling the truth? How do we weigh one version against another? Have we been asking the right or the only questions? Historians go further and ask what a particular event, thought or attitude from the past signifies. How important is it? The answers in part will depend on what we in the present ask and what we think is important. History does not produce definitive answers for all time. It is a process.

History can help us make sense of a complicated world, but it also warns of the dangers of assuming that there is only one possible way of looking at things or only one course of action. We must always be prepared to consider alternatives and to raise objections. We should not be impressed when our leaders say firmly, 'History teaches us', or 'History will show that we are right'. They can oversimplify and force inexact comparisons just as much as any of us can. Even the very clever and the powerful (and the two are not necessarily the same) go confidently off down the wrong paths. It is useful, too, to be reminded, as a citizen, that those in positions of authority do not always know better.

Because history relies on a sceptical frame of mind, whether towards evidence or comprehensive explanations, it can also inculcate a healthy propensity to question our leaders. They are not always right, indeed often the opposite. In 1893, the British naval commander in the Mediterranean, Vice-Admiral George Tryon, decided to take personal command of the summer naval manoeuvres. When he ordered an about face of two parallel rows of battleships, his officers tried to point out that there would be a collision. A relatively simple calculation demonstrated that the combined turning circles of the ships were greater than the distance between them. While his officers watched in dismay, his flagship, Victoria, was rammed by the Camperdown. Tryon refused to believe that the damage was serious and ordered the nearby vessels not to send their lifeboats. The Victoria sank, taking him and 357 sailors with her.

The Charge of the Light Brigade, when the flower of the British cavalry rode straight into the mouths of the Russian guns, is an equal reminder of human folly, not just of Lord Cardigan, who led the charge, but of the system that allowed him to be in command. As David Halberstam, the American journalist, said in the last piece he ever wrote: 'It is a story from the past we read again and again, that the most dangerous time for any nation may be that moment in its history when things are going unusually well, because its leaders become carried away with hubris and a sense of entitlement cloaked as rectitude.'

Humility is one of the most useful lessons the past can provide the present. As John Carey [Emeritus Merton Professor of English Literature at Oxford] puts it: 'One of history's most useful tasks is to bring home to us how keenly, honestly and painfully, past generations pursued aims that now seem to us wrong or disgraceful.' Slavery once had its defenders. Think of the arguments over the position of the earth and the sun, of the conviction, apparently supported by science, that so many Victorians had that there were superior and inferior races, or the calm assumptions even a few decades ago that women or blacks could not make good engineers or doctors.

History also encourages people in the present to reflect on themselves. 'The past is a foreign country; they do things differently there', the novelist L P Hartley wrote. Knowing that classical Chinese civilisation valued scholars above soldiers or that the Roman family was very different from the nuclear one of the modern West suggests other values and other ways of organising society. That is not to say that all values are relative; rather, we should be prepared to examine our own and not merely take them for granted as somehow being the best. Professor John Arnold, of Birkbeck College, University of London, put it elegantly in his book History: A Very Short Introduction (OUP): 'Visiting the past is something like visiting a foreign country: they do some things the same and some things differently, but above all else they make us more aware of what we call "home".'

If the study of history does nothing more than teach us humility, scepticism and awareness of ourselves, then it has done something useful. We must continue to examine our own assumptions and those of others and ask, where's the evidence? Or, is there another explanation? We should be wary of grand claims in history's name or those to have uncovered the truth once and for all. In the end, my only advice is use it, enjoy it, but always handle history with care.