Depends on the fitting. On NPT fittings, pipe dope. One of the attractions of other types of fittings is that they seal without needing a thread compound.
Some guys love locktite. Typically it makes a good seal but it’s hard to get apart.
Be careful with other sealers like Teflon as they can cause issues if you get any inside the hydraulic fitting.
Just had to replace one of the lines going to my chute rotator today. They used teflon tape from the factory on the pipe threaded end that the disconnect was attached to. Just make sure that the tape doesn't go past the end of the threads so if it comes off it can't get into your hydraulic system.
If a fitting uses the threads to seal (tapered pipe fittings), the joint needs sealant. If the threads just hold the seals together (compression, flarred, etc), you should not use anything.
For NPT threads I've used Permatex 80632 teflon sealant made for hydraulic joints, and Loctite 545 also made for hydraulic joints. The Loctite works much better. It does not make the fittings difficult to loosen. I prefer to use JIC fittings where I can and NPT where I have to.