I have two template files I've set up, one for the 'main' file of the project (where all the arrays, global variables and structures are declared) and another for procedures. I have lots of different procedures files, each containing procedures that are related in some way. The first thing I do is create this loop:
Then I think 'Where do I start?'. From there I bash out my first procedure then go out about creating new ones when nessacary. I always deal with the 'blood and guts' of a program first - that's my favourite part. I worry about GUIs and the like much, much later in development.
Now if I come accross a bug the first thing I do is and in 'Debug -1' at a point where I'm fairly sure the bug hasn't (or doesn't) occur. I then re-run the code and add 'Debug -2' a little further on in the code. I carry that on until I can narrow down the line that's messing up. Then I add in a load of debug statmens which output the variables that I'm using, so I can see whats happeneing to them. From there I can usually work out what's going on. If a bug really defeats me I just rip out a section of code and rewrite it, making damn sure no bug gets back in

.
I never leave a bug to go and write new code - I always deal with them. Unfortunatly this means I tend to generate huge numbers of slightly different versions of the same code - which can be a nightmare for anyone I'm working with!
Sometimes you can just see or work out a bug in your head - for some reason I always work them out on the bog. I've done some of my best programming there without writing a single line of code!