Just practise.

The point is if you're going to take a stab at a point with nothing then you gotta remember you had nothing.

Before each decision think about the range of hands he could have. Count the number you are ahead of compared to the number you are behind.

In the hand above, you were ahead of exactly 0 hands. That means the only way you can win is if he folds. The problem is this.

Noone in the history of poker has ever folded after they were allin. You cant bluff someone after they put you allin so just get over it and play the next hand. You took your chance and it didnt work. "Don't throw good money after bad money" is something you will hear alot and it applies perfectly to this situation. If you really want to punish him for trapping you/ sucking out on you or what ever it is this punk is trying to do to tilt you then punish him by not paying for his next night out