When you want to sell some items or if you want to buy some new equipment, ask an NPC for a trade. The NPC Trade window will open up. By pressing either Sell or Buy, you can quickly see which items you can sell to or buy from that NPC.
You can select how many of an item you would like to buy or sell by using the slider, or simply type to input the amount. The selected amount, the price for the selected number of items and the money you have in your inventory are shown below the slide bar. Finally, press Ok to confirm the trade. You can also use the search field to type an item's name (or part of it) so find what you are looking for quicker.
The dialog will only allow you to complete trades for which you have enough money, space and capacity.
The order in which the items appear on the trade list can be changed from the sandwich menu at the top of the trade dialog. This menu also offer other options, such as buying the items inside Shopping Bags, which is useful when buying large amounts of non-stackable items.