Honestly? Go through hell. Speaking from experience, this is how I've learned to be positive. But you have to stay realistic at the same time. You can't expect everything to go well, and what doesn't turn out the way you like, you can always learn from and use to improve situations later on. There's no working your brain to change the way you think, believe me, I've spent most of my life trying to control and reverse my way of thinking. The only way to "fix" it is to let what comes your way, shape your mind, but without letting the bad events in your life leave you jaded.
Along with keeping it realistic - you have to learn to accept that you can't force yourself to be happy, you must learn to just BE. You have, regardless of your situation, no choice but to survive, and most likely, you will as long as you don't intentionally wreck your chances. It helps to realize that there is literally no one on this planet that can destroy you, so long as you don't let them. This isn't happy mythical bullshit I'm spewing out my ass like a sparkly rainbow, it's pure fact. What will they do? Shoot you? Then they have karma and the slammer to worry about, essentially all they did is destroy themselves.
So, don't give into anyone's bullshit. If you want a positive attitude and peace of mind, you can't let yourself get stepped on, as it will only push you the other way. This is what I've learned by doing, not by reading self-help books or being taught by others.
What is the best way to develop a positive attitude?