Fear in gymnastics is not a bad thing. Its a very good thing, the kids with no fear go and throw a skill they aren't ready to do and often injure themselves. You need to learn to tune into your fear. A lot of the time when you are too afraid to do a skill it is your body telling you that you are not ready, you need to listen to your body. You may think you are ready to do it because you can do it fine with a spot but often once the spot is no longer available the gymnast changes their technique's, so you may need more in order to be ready.
It takes time and practice but eventually you should get to the point where you can read your fear and know when it is irrational and know when it is telling you you're not ready.
The first step to dealing with your fear is to do a quick thinking check. The main reason for kids not being able to do their skills is that they are thinking negative thoughts. Pay attention to what you are thinking before a skill. Make sure its not "I'm going to stuff this up". "I can't do this", "I'm going to land on my head". If you think this way of course your body is not going to let you do it. Try instead to focus on more positive thoughts, usually the best are things your coach has told you to do/ "Strong take off", "shoulders, hips knee's" or whatever you are taught to think.
If this doesn't work try visualization. Picture yourself doing the skill perfectly and landing well just before you go for the skill. For some people it helps to watch someone else do the skill first to aid in the visualization process.
If this doesn't work then you probably need some more drills to help you work up to this skill. If you are trying a Back handspring on beam for example without a spot, you may need to start with a mat over the beam, or mats built up to near the beam height and work your way down. This can work with any skill on any apparatus, just think to yourself "What can I do to make this skill less scary". "what would make me more comfortable to do this skill", or "what is a step between where I am now and doing this skill on my own".