When I make brownies at home, the same thing always happens to me: either I leave them in too long and they come out like a brick, or I'm afraid to let them cook longer and they turn out undercooked. The key is not to rely 100% on the oven time, but instead to stick a toothpick in the center about two minutes before the recipe says - if it comes out with some chocolate crumbs stuck to it (not completely clean), that's the sweet spot. Another important detail is taking the brownie out of the oven while the surface still looks a little wet, because it keeps cooking from the residual heat while it cools down, and that gives you that fudgy, gooey center you're after. Oh, and make sure your chocolate is good quality and use butter instead of oil if the recipe allows - it makes quite a difference to the final texture.