Brown bacon in the bottom of a pan. Add in garlic, onions, and butter. Allow bacon to cook through and onions caramelize.
Whisk in sugar and brown sugar. Make sure there are no clumps of brown sugar.
Bring to a simmer and carefully stir in green beans. Lower heat so that the bottom of the pan doesn't stick. Make sure to get green beans coated with sauce. Allow to heat for about 10 minutes.
Recipe by A Camera & A Cookbook at https://acameraandacookbook.com/candied-green-beans/