Does anyone have any advice for how to effectively learn and memorize melodies or lead lines? I don't really have any disciplined form of practice (I just pick up my guitar and screw around) but I've always found it very difficult to commit such parts to memory and I think that's been a real barrier for me. I don't otherwise have memory deficits, but it seems to me like I've always had difficulty in this area. What do other people do?
Just today I thought that it would be good to learn Cause We've Ended Up As Lovers (Beck's version), although the task does seem daunting to me.
Any words of wisdom?

Thanks!