Practice. Lots. Then practice more. Then a lot more. Repeat.
When you play by yourself, make sure your practice time is "quality" practice. Meaning, don't just bang balls around. Focus. Play like it's the finals of a big match. You gotta burn that muscle memory in. Sometimes (many times), it's hard to concentrate for long sessions. When your focus slips away, take a 10-minute break. Slapping balls around with a floppy "I don't give a crap" stroke only hurts your game.
As for strengthening the mental game, you just gotta play for money every chance you get. It doesn't have to be big money, but it has to be enough to make you *want* to win. Play your friends for a beer, or table time, or a couple bucks per rack. Move up to playing better players. Negotiate for some kind of a spot, but you're still gonna have to earn the win.
After playing under pressure long enough, you'll get used to it. How long will it take? No clue. Everybody is a little different. Unfortunately, it won't be overnight.