I have downloaded moodle and I want to edit the modules and create my own. However I don't know how to edit the php code or does this have to be done in notepad?
Yes, you can do it with notepad for example. Files for modules can be found in /moodle/mod/modname/ dir. I started making a moodle module one week ago and I suggest you to learn moodle programming logic first. It isn't so simple to start making mods if you don't know anything about moodle functions.