Visualization, grounding, and a focused mindset are key to spell casting. It seems like you may not be very learned as of yet, and I reccomend reading up on the basics first.
Find out what magick can and cannot do, how to direct intention, and how to use and gather energy from the universe. Keep an optimistic attitude when casting, thinking about, and writing spells to increase their likelihood. If you believe a spell will work, it will, but if you think it won't, it won't. Another thing to note is that some things are impossible, such as change in form, shape, color, and gender. Do some reading up on the spell you want to do, and then try again :)