Hey Hamza, Yes this can be really frustrating. I think the best way to get around this issue is to make sure you take your time in these moments and also try to think of what you were doing in the match that has got you into that position, so what tactics and shots have been working well to get the lead. The you need to focus on these areas and try to continue doing them as much as possible.
Also try to avoid focusing on the score and just think about the match tactics and how to get your best shots into play. A lot of this will change with confidence as well, once you get rid of the fear that you will lose from these positions it will help a lot. Dan