Basically, you add a small amount of sterile/distilled water to the yeast cake after you've racked the beer out. Pour that into a sanitized container (I use a large mason jar), and let separate. Pour off the yeast into another sanitized container or containers, leaving the trub behind. Top off container with sterile/distilled water as needed to fill the container. Store in the fridge until needed.
That's the condensed version.
Here's a pretty good guide. You can search this board or google for yeast washing.
I read that the yeast shouldn't be stored beyond 4 months or so, but I haven't put that to the test. I always seem to use it faster than that.