Hey there, Lyan Delgado
Please can you sign into your Microsoft account via this link: https://support.xbox.com/en-GB/help/subscriptions-billing/buy-games-apps/refund-orders
Once you have signed into your accounts, you will be able to see your recent purchases. Can you see the item you gifted to your friend?
If you do, please click onto the item and request a refund. This will send the request to the refund team at Xbox who will decide on the refund request. You should get an email about this to your inbox.
If they don't authorise the refund, please respond to them via the email so you can discuss this further with them.
Hope this helps,
Nathan