To use dye pick it up and right-click on the item. If the item is dyeable it will change colour appropriately, both on the inventory icon and in game.
Note: This technical section pertains to modding!
A dye works as an augment, applying a permanent status to a specified item when used. However, the dyes themselves do not recolour the item. Instead, the item itself has a section of code in their ".head", ".legs", ".chest", or ".back" JSON file, which tells the game what colour pixels to replace with other colours when the dye is applied.
In the game's files, the clothing and clothing icons themselves are not stored in the colour values you see in-game. Instead, all pixels that are to be affected when dye is applied are stored in the following four colours as hexidecimal code:
Light Tan (#ffca8a), Dark Tan (#e0975c), Light Brown (#a85636), and Dark Brown (#6f2919)
When a dye such as, for example, Red Dye is applied to an item, these hexidecimal colour values are replaced with other hexidecimal colour values. What colour replaces the default tans and browns are defined in the item file itself. Any colour not defined in said file will not be recoloured.