In a large skillet over medium heat, cook the bacon until crisp. Transfer bacon to a paper towel-lined plate to drain and crumble when cool.
Drain all but about 1 tablespoon of bacon fat from the skillet. Add the chopped onion and sauté until translucent, about 5 minutes. Add the minced garlic and cook for 30 seconds until fragrant.
In a bowl, whisk together brown sugar, ketchup, molasses, mustard, Worcestershire sauce, salt, and pepper until smooth.
Combine the drained beans, sautéed onion and garlic, crumbled bacon (reserve a little for topping), and the sauce mixture in a 2-quart baking dish. Stir gently to combine.
Cover the dish with foil and bake for 30 minutes. Remove the foil, stir, sprinkle the reserved bacon on top, and bake uncovered for an additional 25–30 minutes until sauce is bubbly and thickened.
Let the baked beans rest for 5 minutes before serving. Adjust seasoning with salt and pepper to taste.
Notes
Can be made a day ahead and reheated. For a smokier flavor, use smoked bacon or add 1 tsp smoked paprika.