Remove the prime rib from the fridge 2-3 hours before cooking, and allow it to come to room temperature.
Preheat your oven to 450F/230C. In a small bowl, mix together the butter, garlic, salt, thyme, rosemary, and black pepper.
After the prime rib has come to room temperature, pat it down with paper towels to make sure it's dry. Then rub the entire outside of the prime rib with the herb butter mixture.
Place the prime rib in an oven-safe pan or roasting tray with the bones-side down, fat-side up. Place the onion slices in the pan around the meat, if you're making the red wine au jus. If not, you can omit the onions.
Cook the prime rib in the center of the oven for 20 minutes at 450F. It should get a nice sear on the outside. If not, cook it a few minutes longer. Then reduce the temperature of the oven to 325F and continue cooking until the internal temperature reaches 120F (about an hour and a half), for medium-rare. But go by temperature, not time, as it will depend on the size of your prime rib and your oven.
Remove the prime rib from the oven and let it rest for 20-30 minutes. You can tent it with aluminum foil to keep it warm. Then, remove the string and bones, and slice it up into thick 1/2" slices.