Heat the butter and olive oil in a frying pan. Place the chopped onion in the pan and start frying over low heat, stirring, for 10 minutes. Pour in water and simmer under the lid for another 15 minutes. Check the amount of water, add a little if necessary as it cooks down along the way.
Add salt, sugar, pepper and lemon juice. Stir and simmer for another 10 minutes. The onion should become very soft and paste-like. If it is not soft enough, add a little more water and increase the simmering time by 10-15 minutes.
Onion confit should not be runny, the consistency should be more like chutney.