One, practice with it. Under stress your brains turn to liquid and run out your ears. Operating the firearm should be second nature. You're not going to be thinking about stance or grip or sight picture or breathing. You're going to be thinking "holy ****!" or "that bas*****!" or some such.
Two, maintain it. Some manufacturers have excellent reputations for quality and reliability. Some less so. If you're going to trust your life to this piece of equipment, learn to maintain it in top working order. Even good firearms will only stand up to so much abuse. More economical firearms, properly maintained, can still operate reliably.
Three (bonus advice). Get some training. Like so many things, using a firearm in the real-world is not like what you see on TV. When it is life and death, do you want to think you know what you're doing, or do you want to know that you know what you're doing?
Excellent advice and I will take it to heart.