Garlic cooks much faster than potatoes, so roasting them together often means that the garlic will burn. In order to prevent that, hold back from adding the garlic until the potatoes are mostly cooked. Take them out of the oven halfway through the roasting time and toss to coat with the finely minced garlic, then finish roasting.