If you're in a DM or server in Discord and you've received a gift link, you can directly click on the green ' Accept' button that's tied to the gift!.
If you're already logged into your account on the browser or desktop version of the Discord app, you can easily claim a gift! If you accidentally claimed the gift on the wrong account, Discord is unable to provide you with another code or transfer the gift! Before claiming a gift, make sure you are logged in the correct Discord account on the desktop/browser version of the app!