I've got a mixed bag of experiences with this. Most big publishers' websites and online retailers like Amazon have "Look Inside" features that let you peek at the first chapter or so. It's really useful to check the writing style before committing.
That said, I've run into some annoying situations where the sample is literally just the copyright page and table of contents, which tells you nothing about the actual prose. For popular stuff, you're usually safe, but for older or more niche titles, the preview system seems inconsistently applied. I wish there was a standard number of pages they'd all agree on.
Sometimes, if the official channels fail, I'll check if the author's personal website or blog has posted an excerpt. A few writers I follow do that, and it feels more personal anyway.