Preheat the air fryer for 2 to 3 minutes at 375°F to 400°F.
Cut the broccoli into bite-sized florets, and if using frozen broccoli, shake off any loose frost without thawing.
Pat the broccoli dry well so excess moisture does not block browning.
Toss the broccoli with olive oil, garlic powder, salt, and black pepper until evenly coated.
Place the broccoli in the air fryer basket in a single layer, cooking in batches if needed to avoid crowding.
Air fry fresh broccoli at 380°F to 400°F for 8 to 11 minutes, shaking once around minute 5, or cook frozen broccoli for 12 to 16 minutes, shaking once moisture starts evaporating and again near minute 12 if needed.
For extra crisp edges, raise the heat to 400°F for the final 1 to 2 minutes and watch closely.
If using parmesan, add it during the last 1 to 2 minutes so it melts and lightly crisps.
Finish with lemon zest or lemon juice after cooking, then serve right away.