Hello, thank you for reaching out to Microsoft Q&A.
Go to your Microsoft account Order History page and check the order status:
https://account.microsoft.com/billing/orders
If the order shows as successfully completed, make sure you entered your friend's email address correctly. Also, ask your friend to check their Junk or Spam email folders to see if the gift notification from Microsoft ended up there.
Another important point is that Microsoft gift card codes are region-specific. If your friend is located in a different country/region, the code may not work.
If you are both in the same region and your friend still hasn’t received the gift card code, I recommend reaching out to Microsoft Store Support here:
Help with Microsoft Store purchases
Microsoft support agents can review the order details and help resolve the issue. Having the order number and a screenshot of the error message ready will help speed things up.