If you are just starting out then any text editor will be ok and probably try Notepad++. Or if you would like to jump straight into the deep end, then maybe have a look at an IDE like Netbeans
which has a lot more bells and whistles..
For debuging js, I suppose the easiest tool would be Firebug in the Firefox browser or the web developer tools in any of the other major browsers.
If you're not comfortable using a debugger, you can always use alert()s in your js code to check values of variables etc.
If you need more help, post back with your code and we can try to help you get it working.