Preheat oven to 425°F (220°C).
Wash the green beans and dry them thoroughly. Trim the stem ends.
Place green beans in a large bowl.
Add olive oil, minced garlic, salt, and black pepper.
Toss until evenly coated.
Line a baking sheet with parchment paper.
Spread green beans in a single layer on the baking sheet.
Roast on the middle rack for 14–16 minutes.
Toss halfway through cooking for even browning.
Remove from oven when edges are crisp and slightly golden.
Sprinkle with Parmesan cheese and red pepper flakes if using.
Serve immediately.