Reading above, there is a critical area that hasn't been addressed: your DESIGN
For me, this has been one of the most confronting truths to come to grips with. If you have designed a solution, you are naturally biased towards it and sometimes it becomes hard to see the 'forest for the trees'. IMHO, some of the most frustrating "problems" I have tripped on, have been due to one or two (or both) reasons:
- flawed design
- ugly code smells, that did not naturally reflect my design
It is really hard, as a programmer, to admit these things. But cleaner, more natural code is, the more likely to do the task we want, and is easier to modify in the future.
So to answer the question - question you design first! Then look for help.
Of course, if you're just plain stuck on something - thank goodness that STACKOVERFLOW is here to help :)