Cut the onion into thin slices or dice and then shallow fry in oil. This may be to 'sweat' the onions (allowing them to become translucent without colouring) or to fry them to a deep gold colour to develop their characteristic flavour.
Alternatively, drizzle large, chunky slices with olive oil and gently roast in the oven for about 40 minutes.