Brett is a wild yeast, not a condition. Its presence is determined by many factors including weather conditions and winery hygiene. It can affect wines one year and not the next. One way winemakers combat it is with sulphur or sulphur compounds. Not surprisingly, wines with no added sulphur often have a higher rate of brett infection, so you should probably be wary of those. As zin1953 points out, a little brett is not always a bad thing, and certain wineries are prized for their brett-affected wines — Beaucastel and Musar are two sterling examples — so you can steer clear of them (though, please, not without trying them first; like legions of wine lovers, you may find there are some bretty wines you love).
Generally speaking, newer wineries and old wineries with new wine-making facilities tend to have better hygiene. The same holds true for larger “industrial” wineries. So one tactic, perversely, would be to avoid artisanally produced wines; unfortunately, doing so would also mean cutting yourself off from some of the most interesting wines made these days.
Read tasting notes. Query retailers. Google the names of wines you’re considering along with key words like brett, funky, barnyard.
But even then it’s something of a crap shoot. Last year I bought two bottles of a 1999 Gigondas from Château Raspail. The first, opened at a tasting, reeked to high heaven (one taster memorably described it as like a donkey defecating into a vat of blue cheese) though it tasted fine. The second bottle, opened a few weeks later, was clean as a whistle. Same wine, same vintage, same case. Brett happens.