Instead of thinking only of the short term consequences, focus your attention on the greater good of speaking up. When you stop to take a moment to think about that, it becomes automatically easier to build your courage. For example, suppose you see someone in your school being pushed around, instead of thinking, "I'm sure they will stop soon." think "If I confront the bully now, the bully may stop completely. And even if they don't, I can tell an adult and they will help me end this."
Stop and breath
When confronted with a situation where you feel it is the right thing to do is to speak up, then stop for a second. Take a deep breath. If you still feel as though it is a good idea, then take a second to build up your confidence and go for it. This may seem like it doesn't work, but if you truly think that saying something is needed, it is an easy way to calm your nerves before speaking up. Emotions play a role in speaking up. When we stop and take a breath, we gain control over our actions. Emotions usually have a lot of control over us, but they don't have to. Emotions are not bad, but we can't let them control our actions. If we stand back, observe what emotion we are feeling, we have control over what we do next. When we do not identify what we are feeling, it is easy to lash out or say something that we will later regret.
think it through
Before just going and saying something, make sure that you know exactly what you want to change. For example, if you feel like your voice is not being heard, it works best to have a specific example of when you felt like that. This give evidence and also points out what you want to change. If you say something vague like "You are not listening to me" it may help for a little while, but usually not for very long. Gradually things will go back to how they were. If you instead said, "I don't like how you talk over me, and I don't feel like you are listening to my opinion. I would appreciate it if you wouldn't do that anymore." you may get a different reaction. This statement gives a specific example of what the person should change, and then states your opinion.
If you want to learn more about this topic, here are some websites you might find helpful.