How to professionally inform of my intention to quit my masters
First, there shouldn't be any shame involved. For some reason you have learned that what you are now doing isn't right for you. That is perfectly natural, even if you are struggling at the moment. But before you decide finally, make sure it is the right decision. 

As to how to do it, a face to face meeting is the best way. But before you have the meeting, think about what your future plans are so that you can talk about them as well as about quitting. If you think you may want to return later, you can work that in. The academic life isn't for everyone, and it may be a good thing if that is the case for you and you learn it now. 

Your advisor may even have options available that you haven't thought of, but face to face is best. If you want to give him/her a heads-up on your intentions, send an email asking for a meeting to discuss your future. 



You don't say why you are considering quitting, and you need not. However, there are at least three common reasons. First, is just external pressures that need to be dealt with. Second is burn-out that is pretty common also, and can lead to health issues. That can be overcome in some cases with help. 

But the third reason is one to consider. There is a condition called Imposter Syndrome that affects many students at a certain point. It is the deep feeling that you don't belong because you "aren't good enough." That is often a bit related to burn-out but it is also pretty often completely unjustified. One of the reasons for speaking to your advisor in person is that he/she might just reassure you that you are, in fact, good enough. I suggest that you investigate Imposter Syndrome online as a start if you think this resonates.