NO POLITICAL/SOCIAL issue has been more punishing to countries around the world than that of trying to manage -- to tame -- ethnic differences. It takes great effort and tolerance and some magic. So it has to be regarded as problematical whether the Sinhalese majority in Sri Lanka can now find peace with the aggrieved Tamil minority and especially with the element of it that had turned to terrorism in the pursuit of a separate state over the past four years.

If there is a bit of justice in this world, however, the political settlement just offered by President Junius Jayewardene will bring Sri Lanka the respite it deserves. It is a friendly, unoffending, democratic country that has sought to serve the needs of the common people. The Tamils had real social and economic grievances, but the Sinhalese seem at last to have recognized them. The new offer of autonomy now made to the Tamils has cost the government heavily among its own majority community.

In Sri Lanka, the problem was never just to find a new pattern of relations between Sinhalese and Tamils. It was to fold in India, which, by virtue of its location across a narrow strait, its own immense Tamil population and its weight in South Asia, was bound to play a crucial role. Until recently, that role seemed mostly negative. India was in effect encouraging Tamil separatism. Indian Prime Minister Rajiv Gandhi, however, has now accepted the full implications of India's overwhelming importance to Sri Lanka and has joined it in sponsoring and guaranteeing the political settlement that was announced this week.

Under the new Indian-Sri Lankan agreement, India takes on an obligation to suppress terrorist sources in India proper. At Sri Lankan invitation, moreover, it immediately sent peace-keeping troops to the island state. These troops will help the inadequate forces of Sri Lanka put the political part of the settlement into effect. That means not only helping to disarm secessionist guerrillas but protecting them, once they are disarmed, from Sinhalese wrath.

For Rajiv Gandhi, who has hit rough political weather recently, it is a risky enterprise but a timely demonstration of leadership. For India, beset itself by ethnic tensions, it is a useful exercise in combining the elements of firmness and flexibility required to deal with this explosive problem at home.