I'm currently working on a biggish pet project that's pretty out of my usual comfort zone- starting up a website (which I'm terrible at) using jsp (which I've never used before) and tomcat (again, starting from the ground level) to help people show off their Java applets and applications (deployment has its own set of icky problems). So there are times when I get pretty frustrated with how slow it seems things are progressing, since I spend a lot of time going through basic tutorials instead of actually working.
But then I think about my end goal, and the fun I'll have once the website is established, or just being able to have something to show for my work. That gets me excited about the project again, and it lets me get back to work. Going on a walk or putting on some music doesn't hurt, either.
I think that way of thinking can be applied to pretty much any task. I don't know anything about swimming (I can't swim!), but I would assume it helps to be genuinely excited about your progress towards some goal. That's probably true for most things.
That being said, there's also a downside to thinking too much about your end goal- it's important to not get sidetracked, and to work on finishing the little things before worrying about bigger picture stuff. Daydreaming about your goals is a good motivator, but it's also important to become actually excited about the progress you're making and to continue making that progress.