Press F to talk with an NPC. Once the conversation opens, look for a small box labeled "Trade" and click on it. That brings up the trade interface, where you can buy and sell items with them.