Forbes Burnham, 62, the president of Guyana and the leader of the former British colony on the northeast coast of South America for the past 21 years, died yesterday in a hospital in Georgetown, the capital of the country, while undergoing surgery on his throat.

The state radio announced his death and said he would be succeeded in the presidency by Prime Minister Desmond Hoyte. The announcement did not disclose the purpose of the operation. Mr. Burnham had suffered from heart ailments in recent years.

In 1964, he came to power in what was then British Guiana in elections in which he defeated Cheddi Jagan, a mercurial Marxist who had alarmed London and Washington. Mr. Burnham, a former ally of Mr. Jagan, led Guyana to independence in 1966 and introduced his own form of socialism at home and sought to maintain a neutral policy abroad. In 1980, with the adoption of a new constitution, he took the title of executive president. While Mr. Burnham's rule was arbitrary and included the suppression of such institutions as an independent press, the country maintains the form of a parliamentary democracy.

Jonestown, Guyana, was the scene in 1979 of the mass suicide of 900 followers of the Rev. Jim Jones. They had gone to a remote district in Guyana to establish the Peoples Temple, an agricultural commune. Rep. Leo J. Ryan (D-Calif.) was shot and killed during a fact-finding expedition there. While Mr. Burnham's government welcomed the Jonestown people, it was not responsible for the suicides.

The policies of Mr. Burnham failed to move his country, which is about the size of Kansas and has a population of about 1 million, out of economic stagnation. One of Mr. Burnham's basic tenets was that Guyanese should grow the food that they eat. He banned imported foodstuffs and this led to unrest. At one point striking miners of bauxite, the nation's most valuable natural resource, demanded to be paid in food.

In foreign affairs, Mr. Burnham drifted toward Cuba. In 1983 and 1984, the United States suspended loan programs and blocked a $40 million loan from the World Bank. Relations between Guyana and its partners in the Caribbean Community (Caricom) also have deteriorated. The failure of Guyana to pay its debts to the regional trade organization was largely responsible for the collapse in 1983 of its credit system.

While distancing himself from Washington -- he had not visited this country since the administration of Lyndon Baines Johnson -- Mr. Burnham established diplomatic relations with Moscow and Peking and signed trade agreements with China, Bulgaria and North Korea. He was a vehement critic of the U.S. invasion of Grenada in 1983 and accused Caricom members who supported the operation of being imperialist puppets.

When he first came to power, Mr. Burnham himself was a beneficiary of "imperialist" interests. A constant factor in Guyanese politics is the question of race. The country was discovered by the Portuguese in 1499, settled by the Dutch in 1581 and taken over by the British in 1814. Sugar was the principal crop and African slaves were imported to work the plantations. With the abolition of slavery in the British Empire in 1834, the blacks went free. Their places in the sugar fields were taken by indentured East Indians.

Today, 51 percent of the population is East Indian in origin. They are small shopkeepers and marginal farmers. About 43 percent of the Guyanese are black.

Mr. Burnham was black; Mr. Jagan of East Indian origin. In the 1950s, Mr. Jagan was able to use his background to win elective office under the colonial administration. In 1955, Mr. Burnham broke away and formed the Socialist People's National Congress Party. But Mr. Jagan and his People's Progressive Party continued to prosper at the polls.

In 1964, after a series of strikes and riots in which 165 persons were killed and hundreds more injured, the British changed the election rules to favor Mr. Burnham. It has been said that the CIA gave covert support to this activity. Mr. Burnham afterward was successful in maintaining himself in power and in the late 1970s even received support from Mr. Jagan.

Linden Forbes Sampson Burnham was born on Feb. 20, 1923, at Kitty, a town near Georgetown. He was educted there and in London, where earned bachelor's and law degrees at the University of London. He was a notable public speaker and won the Best Speaker's Cup at University College in 1946. In 1949, he returned to Georgetown and established himself in a law practice and joined Mr. Jagan in starting the People's Progressive Party.

An imposing figure more than 6 feet tall, Mr. Burnham was known for his ability to charm audiences with a folksy humor. He reserved most government posts to fellow blacks, and blacks also made up the largest part of the army and police forces. This helped ensure his hold on the country.

Mr. Burnham's survivors include his wife, Viola, and their two daughters, and three daughters by a previous marriage that ended in divorce.