If you have access to one that doesn't require payment, that's the best way. But sometimes you can't have that...

This won't work in all washing machines, and may even jam it up, so don't do it if you really need something washed and washed now.

If it's one with the flat coin mechanism where you stand up a number of quarters (or whatever coin) in slots, then push it in to pay, this may work.

You cut a strip from a pair of pantyhose. It should be about 1 1/2 - 2 inches wide, and kept in a loop (in other words, cut the leg horizontally). Then you place it around the coin holder, over the slots. Put the quarters in the slots, and push in carefully. The hose will keep some or all of the quarters from falling through.

The hose degrades pretty quickly, so don't be afraid to cut another loop after a few washes.

Disclaimer: I do not endorse using this trick on any machines you do not own, as it is stealing. They provide you a service by having the machines so easily accessible, and if you abuse it, then you'll have to go to a laundromat. This is noded for informational purposes only.