The first is to "Make It Work."
Get the code accomplishing the task that you need it to. Doing TDD? Write your unit tests, then dive into the code and get to work. Change code until those new unit tests pass. Hack away at it. Just get something together that does what it is supposed to do and fulfilling the requirement you are working on. Make it work!
Second, "Make it Right."
If you cut corners or used ugly code to get your feature working, now is the time to pay the piper. Start refactoring that code. Look for places that you duplicated logic, and find a way to make that code shared between both places. If you did TDD, you have your unit tests to catch any time you break the working functionality. If you didn't do TDD, add your unit tests now. Look objectively at your code: is it maintainable? Or did you try out a cool coding trick that in retrospect over-complicates the logic? Will other developers after you be able to understand it? Do you need to extract some methods so it's more clear how things are flowing? In short, make sure your code follows good coding practices and standards.
Third, "Don't **** it Up."