Convert MTB mechanical disk brakes to hydraulic
Worth reading, not a dup - What is the difference between I.S., post, and flat mount disc brake mounting standards? - 

The calipers are (mostly) standard mounting, its the mounts that determine the size of the disk used. Therefore you can 'just' (that infamous trivializing adjective) buy a new set of brakes, bolt them on and start riding.  

When buying, you can buy prebleed brakes ready to bolt on with hoses attached. This is easy but the hose length is usually a bit too long - however no bleeding is required. Its possible, in theory and if done with care, to shorten the hoses without needing a bleed the brakes afterward. 

If you go with pre bleed brakes, be sure to get the correct 'handedness' of the levers. Different countries have the brakes on different side, the front brake will have a shorter hose and rear brake a longer hose.