How to avoid garlic turning blue after cooking?

Normal stuff. Happens often for example, when putting them inside a fish to cook in an oven.