In a heavy-bottomed pan, add 1/4 cup olive oil and the chopped onion. Turn up the heat until the onion is almost sizzling.
Stirring frequently, and adjusting the heat as needed to keep the oil almost simmering, cook the onion until it is a rich golden colour. (Don’t let the onion get dark brown as this can become bitter).
Add the garlic and the remainder of the oil.
Increase the heat until the oil is almost simmering, then turn down heat just enough so it continues to barely simmer for 20 minutes
Remove from the heat.
Remove the garlic and onions by pouring the oil through a fine sieve placed on top of a screw-top jar
Cover and refrigerate the oil once it’s cool. Discard the onion and garlic.