If you're moving it between Mac and Windows, you want to format your flash drive with the FAT32 filesystem. It shouldn't matter whether you format it on your Mac or on a Windows machine.
To do it on the Mac, plug in the flash drive, and open Disk Utility (in your /Applications/Utilities folder). The drive should appear in the list on the left of the ** window.
Select the drive, then click the Erase tab. On that tab, select MS-DOS (FAT) as the volume format, choose a disk name if you want to, then click Erase, and wait.
That said, if your drive just "didn't work any more" after a while, it may be faulty and it's possible that re-formatting it won't help. (All flash drives do have a finite number of read/write cycles before they don't work reliably any more, too, although it's unlikely you've reached that limit through normal usage.)