Some great advice here, most especially about it coming with time. Trust me, it does.
Earlier in the thread somebody said to go note by note. With all due respect, I disagree, based on 23 years of playing entirely by ear (one of these days I really need to get serious and learn chord theory, but I'm having too much fun).
It's MUCH easier to figure out the chord progression first, then go back and fill in the details. Many recordings have the bass so buried in the mix that it's very difficult to hear all the nuances no matter how closely you listen. Trying to get every single note out of a recording like that is a great way to get frustrated.
Get the basic structure of the song figured out (start with playing just notes on the beat, changing with each chord change), then go back and get the rhythm of the bass line (assuming it's not just thumping along on the beat), THEN put in all the little fiddly bits. You won't go wrong if you stay in key, even if you're not playing the exact same bass line that's on the record.
Along the way, you might surprise yourself and come up with a better bass line than the original. That happens to me all the time... my band plays only covers, but few of my bass lines are the same as the original. In some cases, they really are a lot more interesting than what wound up on the record.
Most original bass lines evolve over time anyway... the artist screws around a lot. What appears on the record is just what the bassist happened to be playing at the time. It probably isn't what he/she started with.
Prime example: The Beatle's "Ob La Di." The bass line on the record is simple, driving and instantly recognizable. But on the old Beatles demo recordings released a few years ago, McCartney's bass line was TOTALLY DIFFERENT, and very cool. So when I play it, I mix the two lines together and the result is a lot more interesting than the exact line that was on the record.