Answer: Sometimes you don't until you're in it.
When I first moved out to Portland for my husband's job, I had a specific idea of what my dream job would be. I wanted to move out of higher ed, where bureaucracy seemed to hamper everything, and into a small organization, either a non-profit (save the world!) or a for-profit company (make more money!). I wanted to continue doing evaluation work, which I loved, ideally still related to education. And after working in an open office plan for three years as an introvert, I wanted my own office.
After a few months of job searching, I landed what seemed to be the absolutely ideal position. It was with a small educational evaluation firm, where I'd get to take on my own clients — schools and museums — plus as part of my job I'd help manage a non-profit organization the firm ran. And I'd get my own office.
Not so much. First off, even though it was a for-profit company, I had to take a pay cut from my previous position, but I thought it was worth it to do what I loved. Then it turned out the non-profit I was supposedly running had to shut down because the person before me had neglected to do any fundraising that year, which was the only thing keeping it running. And all the new evaluation clients we were supposed to be getting never materialized, so I had literally nothing to do most days (but was still expected to fill out a detailed time sheet of how I spent my day), and I only got handed projects when they'd turned into such a huge mess no one else wanted to deal with them. I also had an hour-long commute both ways, and worked ("worked") an 8-5 day.
So every day I would get up when it was still dark out, take a long bus ride, and sit alone in my office, isolated and bored, until a few months later I finally quit.
I spent some time reevaluating what I wanted out of a job and, just as importantly, how my job should fit into my life. I decided I couldn't do a long commute again; I wanted more time with my husband, my friends, and our kids once we had them, and time for my own hobbies and projects. And I needed to be sure I would like the people I worked with, because you really only get one shot at quitting a job after a few months or your resume starts to look sketchy.
Eventually I ended up taking a job as an office manager on the campus where we live. By my original criteria, it was the exact opposite of what I wanted. It's back in higher ed, and it has nothing to do with evaluation work. I sit at a front desk where people are constantly talking to me, and I answer the phone all day long (introvert nightmare!). And I took another pay cut.
But I love it. I work a 7-hour day plus lunch and I have a 5-minute walk to work, which means I can now wake up at the same time I used to have to be at the bus stop and still get in a half-hour run, shower, and breakfast before work. I work with great people, including lots of people I was already friends with, and I get to have lunch with my husband most days. And it turns out I love helping people, even angry parents. I also have lots of time for my side projects, including doing freelance data analysis, so I can still keep up with that kind of work.
My story is not everyone's story, and I'm not suggesting that you have to try out a bunch of jobs and quit them to find your fit. As I've said before, there is no perfect job. However, this is a good case for internships, volunteer work, informational interviews, and any other research you can do ahead of time. What you think will make you happy in a job isn't always the same thing as what will make you happy.