If you're spell does not work, a few things could happen.
The first is you haven't spent enough time on the basics. To cast a spell, you need to have knowledge on the basics to properly execute a spell. Spells require a clear mind, the ability to focus your intention, and maybe even a strong voive (if chanting is used).
The spell could also be fake, or created by someone who doesn't know anything about the craft. If it was a fantasy spell (levitation, vampires, werewolves, etc) Then I can guarantee it will never work. A lot of people on here will post any type of spell, and either not know what they're doing, or do it for giggles.
Another reason is how you executed the spell. Were you putting your intention into it? Did you believe it to work? Doubt can be a contributing factor to spells not working. It is mind over matter. You have to believe and know your spell will work. It is also good to take into consideration of what you really need. Sometimes spells will not work if you're casting them for greed or self-gain.