Here's a B2B perspective:
The best way that I've found to truly understand what a user is trying to accomplish ("get done") is to put yourself in their world. In order to do this, you need to get out of your office and into theirs. Here are some methods:
Observe - You need to see a user in their natural habitat. Go to where they use your product (and where they don't if it makes sense) and watch how they do it. Do your best to stay hidden (be creepy) so that you're not introducing bias. Watch how they engage with your product, what body language they use, what's going on outside of your product, and how long it takes them to complete a task.
Interview - Obviously the basics are important. Ask non-leading questions, don't ask specific questions, encourage elaboration, etc. The important thing to remember is to allow the interviewee to do most of the talking. This sounds like a given, but it's often taken for granted. I like to start interviews off by asking the interviewee to tell me about themselves and their role, then I simply ask, "what is a typical day like from start to finish." I take note of the interviewee's body language, the words they use, and the inflections of their voice. When thinking about jobs-to-be-done, you really want to understand the users' day/tasks inside AND outside of your product. This will give more context into what problems your product solves for them (where they see value) or where your product is NOT solving their problems (and could).
Surveys - Surveys are a very common method to gather feedback, but it's not the best for JTBD. I would avoid these when possible.
The key takeaway here is to do your best to either DO the job or imagine yourself doing the job that your customer is trying to get done. Put yourself into their day so that you can live what they are living. That's what will give you the best perspective to create solutions.