Adobe provides a program to make scripts called ExtendScript Toolkit, which was most likely bundled with your install of Photoshop. On my computer it's in
C:\Program Files\Adobe\Adobe Utilities - CS5\ExtendScript Toolkit CS5. You can use that or a program as basic as Notepad to create scripts (I use Notepad++), which you then save into
C:\Program Files\Adobe\Adobe Photoshop CS5\Presets\Scripts or the equivalent
Presets\Scripts folder on the Mac. In Photoshop, go to
Scripts to find your script and run it.
Adobe's documentation is a good place to start. They have basic guides to get you started, from "Hello World" on up, and then they have more in-depth tutorial PDFs by language and version.
Sometimes, it's nice to interact with ExtendScript Toolkit's Object Model Viewer (Click
Help up top, then
Object Model Viewer to access it). You'll also find a link to the
Help menu...that gets you some more help with JS functions like the XML Object that are common to all CS products.
If you're looking for help online, the Adobe forums are the most populated. You can also try over on Stack Overflow, but the ExtendScript help tends to be spotty.
If you want help working with ScriptUI, Peter Kahrel's publication on it is really informative and helpful, more so than Adobe's documentation on the subject in my opinion.