Relax, don't worry, and take a couple quick runs at the problem.
Stack Overflow has some pretty good best practices for getting simple things done in a language.
Once you've solved (or tried to solve) the core of the issue once (or twice) you probably have a good idea of how to get it right. Don't be afraid to fail.