Shops - Buying
A shopping area exists in every world, and is either in the center zone of the world, or right next to it. Shops offer many items up for sale, and shopping area merchants accept gold in their shops.
If you would like to buy an item, walk up to the shopkeeper and type "X.” Then, scroll through the available items to choose the one you want. Once you're happy with the item, click BUY.
Shops - Selling
In addition to buying items, you can also sell items to shopkeepers. To do this, interact with a shopkeeper by pressing "X.” Then, click on the SELL tab at the top of the screen. Click the item you wish to sell, and then select SELL.
Items are sold to shopkeepers for a lot less than their actual value. So if you buy something, make sure you really want it!