How do I properly install pads into a Shimano BR-M365 disk brake caliper? I've been an idiot. I took them off the bike this morning, and there's nothing left - the springs have been bent back and stripped off, and that strange 'rubbing' noise I've heard from the back wheel? Yes, it was...

I've bought some new pads, but I don't want to mess things up any further.

How do I properly install pads into a Shimano BR-M365 disk brake caliper?

Any hints, clues, do and definitely don't?
Just because you let your pads get too far worn down does not mean you are automatically going to screw up replacing them. 

Hydraulic disc brake pad replacement is reasonably simple:


Check you have the correct pads for the calipers. 
Look up Shimano's installation instructions. I just googled 'shimano BR-M365' and found the product page. Pad installation instructions are in the dealer manual found on that page.
YouTube is replete with bike maintenance videos. Park Tool has a excellent channel, Global Cycling Network has some good maintenance videos, here is their hydraulic pad replacement one.
The big 'don't' is do not pull the brake lever when the disc is not in the caliper, and especially don't do it when the pads are removed. The pistons will be pushed out to far and do not retract. They can be pushed back in to the caliper (you have to do this when installing the new pads), but over extending the pistons with no pads in the caliper can result in fluid leakage.