Put the lentils in about 1 l boiling water. Cover and cook for about 20 minutes.
In the meantime, clean or wash and peel the onion, carrots and leek. Cut the vegetables into small cubes.
Heat the oil in a pot. Sauté the vegetable cubes while stirring. Sprinkle with sugar, caramelise slightly and deglaze with vinegar. Bring to the boil and simmer for 4-5 minutes.
In the meantime, drain the lentils in a sieve. Wash the thyme and shake dry. Pluck the leaves from the stems. Mix with lentils into the vegetables. Heat everything again. Season to taste with salt and pepper.