To cook asparagus in oven, you have to preheat the oven to 400° F. Place the asparagus on a baking tray and spray some olive oil on it. Toss the asparagus to ensure that the asparagus is evenly coated with oil. Now sprinkle salt, pepper, and chopped garlic and toss again. Place the asparagus evenly on the tray and let it cook for around ten minutes. If you want to make it a deeper brown, keep it in the oven for another five minutes.