Without knowing more about the specific issues, it is difficult to give precise answers to your question. However, if you have reached the point where you are clearly off track, there is no guaranteed method to get you back on the original track.
My advice would be to re-plan your project taking account of the situation that you now find yourself in, and agree with your sponsor / executive where compromises are acceptable. This may be in timescale, or cost, or scope, or quality - or some combination of these. My advice would be to avoid compromising on quality because this is the thing that will come back to bite you at a later stage - but having said that, make sure that the level of quality is appropriate for the project. Unless you are developing something that is either mission critical or safety critical, a few minor "unexpected features" may be OK.
Honesty is the best policy in these situations. Don't pretend that all is OK just now and then present a disaster at the 11th hour. Far better to take a little pain now, work through it, and deliver against your revised plan.
Depending on where you are in the project, you may be tempted to throw resources at it. Be very careful with this approach: it seldom works, and can often lead to further delays or problems. There may be scope to ask your team to work extra hours to make up time, but be careful you don't end up with an exhausted team that is too tired to deliver.
You ask what qualities a PM needs: The top three for me are (in no particular order):
- Communication skills, to deal with all stakeholders (sponsors, customers, team, advisors, suppliers, etc);
- Imagination, to both visualise the outcome of the project and to anticipate the risks that may be encountered, then to put in place the measures required to deliver the outcomes and/or mitigate the risks;
- Persistence, to keep on pushing for as long as necessary to deliver the project (or persuade the stakeholders to kill it).
Hope this helps.