Most equipment can be socketed to hold gems to further increase their stats. Example of these are all weapons, all armors, all wings, and all pets.
For Pets, check the Pet System guide.
The rest of the items that can be socketed all have the same mechanics. First, the socketing is done via the Alchemist NPC - Carmen in Ardeca. Next, a certain amount of dil is spent depending on the level and the grade of the item. The stronger the item, the more dil is spent per try.
For successes, 1 socket is added to the item until the max amount of sockets is reached. Items can contain 1 / 2 / 3 / 4 sockets. It is visually obvious depending on the size of the item. For example, bracelets, and pets only have 1 as you can guess from the size of the item in game. Belts and Wings have 2, while weapons, and armors can get 3-4 sockets.
For failures, 1 socket is removed from the item. If the item has no sockets, the item remains as it is. So an item with 3 sockets failing will make the item have 2 sockets again.
Soul of Alchemist can be used to increase the success in adding sockets to an item. However, crap gems are a lot cheaper. Should there be no crap gems available, you can use the D-shop item. Search for “Soul” in the D-shop to find the box that contains it.