As a rhythm guitarist myself, I somewhat understand your situation. Getting caught up in the other aspects of the song is a valid issue that has made me mess up more bedroom jams than I'll ever admit.
This is a little anecdotal, and may or may not work for you as I'm mostly a metal player. Usually, when I get distracted with other parts, it's because I don't know mine well enough and am looking for something to keep control with. Fortunately, that's easy enough to rectify.
Get yourself some good headphones and get comfortable somewhere (you can use a desk or bed, I usually use my living room floor). Hum the bassline, and vocalize it if you can. You'll know if you're getting it right because you'll feel it in your throat and skull. Learn the notes and changes, and keep singing that to yourself as you play through the song again. You're still listening to something else while you play, which is simply the reality of playing music, but you're doing so in a way that's more beneficial. As you learn the song you'll need to use this less, and can simply keep it in the back of your mind.
I've been teaching myself for seven or eight years now, and it took me about two to get to the point where I stopped getting into your situation; although, picking up the chords or bassline is great for learning songs by ear, which is a powerful skill no matter your instrument or genre.