How to use colour codes
Put the code right before the text it colours: &6Gold &fWhite. Formatting codes go after the colour, because a colour code clears bold, italic and the rest: &6&lBold gold.
&r resets everything back to the default colour.
MiniMessage tags
MiniMessage uses tags instead of codes and closes them like HTML: <gold>Gold</gold> <b>bold</b>. Any hex colour works as a tag: <#ffaa00>. Gradients are a single tag: <gradient:#ffaa00:#ff5555>Text</gradient>.
Hex colours
Since Java Edition 1.16, chat, scoreboards, the TAB list and item names can use any colour. Each plugin writes them its own way (&#FFAA00, &x&f&f&a&a&0&0, <#ffaa00>). The gradient text generator outputs all of them.