You can socket items by using a magic anvil found in dungeons or by visiting Rikko the Enchanter in Grove’s cemetery. Socketing is not guaranteed, and if you pay Rikko, be careful not to spend more gold than you can afford.