Wash the green beans and trim both ends. Dry thoroughly using paper towels or a clean kitchen towel to prevent oil splattering during frying.
Heat the vegetable oil in a wok or deep skillet over medium-high heat until the oil reaches approximately 375°F (190°C).
Fry the green beans in two batches. Add half of the beans to the hot oil and fry for 2 to 3 minutes, or until the skins blister and wrinkle slightly. Remove using a slotted spoon and drain on a paper towel-lined plate. Repeat with the remaining beans.
Carefully pour most of the oil from the wok into a heat-safe container, leaving a small amount of residual oil in the pan.
Reduce heat to medium and add the butter to the wok. Once melted, add the minced garlic and cook for approximately 30 seconds, stirring constantly, until fragrant.
Stir in the chili pepper flakes (if using), salt, sugar, and soy sauce. Cook for 30 seconds until well combined.
Return the fried green beans to the wok and toss gently to coat evenly with the garlic sauce. Stir-fry for an additional 30 seconds only.
Immediately transfer to a serving plate and serve hot.