Simply go to any merchant, click and hold the left mouse button on the item you wish to sell, pressing the right mouse button which will bring up some form of circle menu while still keeping a hold on the left mouse button, and drag it into the merchant's inventory to earn 2x as much gold! Then repurchase the item regularly and repeat the process.
(The link above is to another guide provided by Taya if you want more details about the gold glitch)