Shit will happen

Yesterday I finished a new design for this website. Everything was running smoothly. I was really happy with the results, and all I had to do was to make some changes on the IP and finally today I’d be able to focus 100% on a new project. But at the last hour, shit happened.
In the easiest step of the process, you don’t expect problems to come—so they will.
I saw the problem yesterday before going to sleep. And I’ve spent half of the day dealing with that problem. But the worse part is the opportunity cost of not working on the new project, so what should I do?
As you’ve noticed, it’s easy to get upset with a problem. I got frustrated because I haven’t spend my time in what I had planned. But there’s another way to tackle problems.
My mistake has been trying to fix the problem at all cost. I was upset. I was like a kid when picks an awesome ice-cream and suddenly it falls to the ground. That feeling.
Problems will arise. Always. The difference resides in what you do with them. Should I stick with it until I solve it no matter what? Or can I procrastinate and stick to the plan?
Sometimes problems can’t wait and we have to deal with them. But that’s rarely the case.
Hold them, do something else and when you have a fresh mind, tackle them again.