Hello,
Digital purchases are generally non-refundable. However, if the purchase was genuinely made in error, Microsoft support might be accommodating. To seek a refund, you should use the Get Help app to contact support and explain the situation. The decision to approve the refund is at their discretion.
On your computer, launch the Get Help app from the start menu, then type in Refund as the keyword. On the next page, you can click on "Contact support" button. Then fill out a few more details and you will be directed to the page where you will have the option to chat with a live support agent.