Practice makes perfect. I used to need to get up and look around for a bit.
How do you stay calm in a game?
'The hardest game to win is a won game' - Lasker.
Always keep focus, even more when winning.
'No one ever won a game by resigning' - Tartakower.
In a lost position you can still make it difficult to win.
Whenever either of these situations arise, Stop. Go over the entire board and reaffirm where everything is. Take note who controls what. Do either of you have a bishop nestled obscurely amongst other pieces. Are there outposts that can be used by either. This will help you focus and look with fresh eyes rather than just react. It should also help settle you down and reset your mind. Then Start looking at what can be done, and make a decision. Do you want to make short term goals for material advantage, or for a slower but constant increase of pressure.

Competition in almost anything is in large part a mental game. I've competed at quite a lot of things in my life and been very successful at it due to a mindset I keep. I'll tell you what I used to tell team members of mine years ago, when we'd be in an important or championship match, and team members would tell me they were nervous. (in a bad way). My advise was, look, these feelings you get need to be turned into a good thing. Stop, slow down, think deliberately about the fact that THIS is the time you need to play your best, and that this feeling is the entire reason we play the game. Enjoy it! Take a deep breath, stop thinking about losing, think about playing your best and letting the chips fall where they may. You won't win all the time, nobody does. Feel good for your opponent for besting you when they do; understand that it wasn't easy for them either. But, use that adrenaline to make yourself focus better, not worse. And, it sounds difficult, but once you accept that other players are also trying hard, you'll feel less nervous about what the end result is of any game. Using a tournament as an example, maybe your opponent really is #1 and you're a legit #2. Work hard to take 2nd, don't play down to 25th.

@1g1yy Damn, thanks a lot
@bigD521 Got it, calm down for a minute and think properly again
@tygxc thanks for the quote

I've seen that many times when I have an advantage (especially when its a huge one) I blunder more than usual mostly because I have a mindset that I can't lose with such an advantage. Similarly, when I have a disadvantage, I feel that I cannot win anyway, and end up with another blunder. So, how do stay calm in such a situation, so that you can calculate perfectly?
Chess and golf are very similar in that we rely on our preshot routine, visualization and confidence from our perfect practice and preparation.
Therefore go ahead, take a deep breath, enjoy the moment and then assess your situational awareness.

I probably could have been a little more clear. Think of it like this, you can't buy that feeling. You can't get that feeling in practice no matter how hard you try. A meaningless game will always be meaningless so try not to play them. Play only when you really want to win and there is a downside to losing. With a little practice, the nervousness will actually become your signal to focus, not to take your mind off things or to worry about end results. Competing at anything is not about having fun, it's about winning. You can have fun after you're done winning. Until that time it's work and it should be treated as such. When you get to where you finish a game and you realize you have absolutely no recollection of anything that happened outside of that game, no idea what else happened in the room, you're on the right track. The nervousness will still be there but the only thing it will do is signal your brain to tune everything else out. If you give it some thought before games, you'll be surprised how easy it is.

Experience. By playing chess more and becoming more comfortable in games, then you'll eventually become more calm in a game because it is just another game and winning or not, it will just be routine for you.
You probably get anxious (un-calm) because the experience is new to you still, but once you gain enough experience and get used to it, then the chess will just be like "another day at the office" and you can focus more on in-game things like calculation

@1g1yy Makes lot of sense, thank you
@KeSetoKaiba unfortunately, I have been playing off and on for 3 years, but I still feel this way. Though it might be that the gaps are long, dunno
I've seen that many times when I have an advantage (especially when its a huge one) I blunder more than usual mostly because I have a mindset that I can't lose with such an advantage. Similarly, when I have a disadvantage, I feel that I cannot win anyway, and end up with another blunder. So, how do stay calm in such a situation, so that you can calculate perfectly?
I totally agree with you. Most of the games I have lost are the ones where I had completely winning position. It's always challenging to win the winning position. It's natural to become anxious and this leads to blunders. It's the practice that keeps you cool in such scenarios

Bite on a bullet.
Disclaimer. Not responsible for damage to teeth or lead poisoning or accidental discharge of bullet caused by biting on said bullet. Consult tournament director to see if bullet biting is allowed at tournament. See doctor if you suffer from any of the side effects mentioned above. Do not swallow bullet.
Meanwhile, in the background of the ad:
Late-Middle aged man biking and smiling with his wife and two kids, a boy and a girl. All four are smiling. Scene cuts to them inside the house, where they are happily eating dinner. Later, the man is shown golfing with great vigor.
If you need help, please contact our Help and Support team.
I've seen that many times when I have an advantage (especially when its a huge one) I blunder more than usual mostly because I have a mindset that I can't lose with such an advantage. Similarly, when I have a disadvantage, I feel that I cannot win anyway, and end up with another blunder. So, how do stay calm in such a situation, so that you can calculate perfectly?