In my case I knew what I wanted. Upright Seating, wide 26" wheels on a small frame, Rim brakes, a rigid fork, a low step over height at least 7 evenly spaced gears and good quality parts if available. I wanted trigger shifters, but had to settle with 8/9 checks as this bike came with twist grip shifters.
I then narrowed it down to what my preferred bike shop carried. Then check the reviews, both personal and more professional on line.
I ordered my 2018 Giant Sedona sight unseen. Turned out better then I expected. The most pleasurable bike I've ever owned. Despite its budget price the quality, Fit and finish are 2'nd to none. And the twist grip shifters seem to be working well, just the occasional accidental shift climbing rough trails, which I seldom do.
I had a mountain bike before that was awful to ride. But I think it was just a poorly designed bike. Giant's Talon would have probably been comfortable for me too,