I disagree with a few of those statements in the above post, as they are more personal view/morals, and it does not reflect all of magic as a whole nor everyone's thoughts when doing a spell.
There are many reasons why certain spells will not work. As the previous poster stated, it can be because what is being done can not happen. There could be a block in the way that needs to be cleared. The amount of energy needed to make it happen may not be sufficient. Your own confidence level is possibly not its best. You are not allowing enough time for the intent to come into being. The spell itself may not be well constructed. Sit down, breathe, and take the time to figure out the reason.
Also as the previous poster commented, there is no losing your ability to practice magic. It's not something that can be taken from you.
Take some time to recollect yourself, do a cleansing and take a breathe.