Slice the onions and finely mince the garlic.
Melt the butter in a frying pan, add the sliced onions and garlic, then all you need to do is sauté.
After 10 minutes. Sauté on medium to slightly strong heat until tender and translucent, as shown in the photo.
After 20 minutes, once they become slightly brown and the water content has cooked out, it will burn easily. Reduce to medium heat and continue sautéing.
After 30 to 40 minutes, the onions will caramelize and be reduced to about 1/2 the amount. They're done!
Addendum: After making a large quantity, separate out the amount you will use right away, and divide up the rest into single-use amounts, in resealable bags, for example, then freeze.