What do I have to know, to replace my hydraulic disc brakes with new ones?
(within reason) Any disc brake will fit on any bike with the right adaptors.

The adapter you need will be based on the size of the rotor (disc) you want to run, the mounts you have on the bike (IS/post) and the brake you're trying to fit. Most callipers will have post mount fittings so require a adapter to fit to any IS mounts. Most frames still have IS mounts on the rear, while most newer forks have post mounts. They can be identified through how they are orientated, post mounts go into the fork or frame, IS mounts are orientated the same as the bikes axles. 

When purchasing brakes Shimano callipers come separate of rotor and mounting adapter, Avid comes pre-packaged with everything so you simply buy the size you require. Smaller brands vary.

You need to be aware that the size of rotor makes a difference and some forks/frames are only rated up to a certain rotor size; any larger could cause the parts to fail.

There are two different standards for fixing the rotor to the hub - standard 6-bolt and shimano centrelock.

The bolts are standard thread (for all examples I've seen) but the length will vary for post mount brakes. You need to ensure that you use the correct length screws for post mounts. Short bolts can (some say will) lead to catastrophic failure.

The other point to bear in mind is that the hydraulic hose length for the rear brake may have significant extra length (c.300mm) and requires a moderate level of technical skill to shorten. The rest of the install can be done by hex wrench and T25 driver/wrench. A torque wrench is recommended but not mandatory. Other considerations will be cable routing, securing the hose and whether the brake mounts need facing.