Brake oil came out of the piston of my Tektro hdc 300 and the brake is not functioning. What to do?
If you are going to do it yourself - you will need a hydraulic brake bleed kit.
You basically need to replenish the fluid in the hydraulic system.
This will either be mineral oil or Dot brake fluid.
Check with your brake manufacturer which it is.

There is a technique and procedure to bleeding brakes as well. Weigh up the cost of doing it yourself - or just paying an experienced cycle mechanic to do it. Its a fairly standard job and shouldn't take long at all - especially if it is only one brake.
Most hydraulic brakes are maintenance free - in that the system is sealed and air does not get into the system.

Unfortunately, you found to your cost - by removing the pads and pressing the levers - you popped the pistons out of their seating (and seals) which leaked all the fluid from the system. A tip would have been to wedge something between the pistons of the padless caliper - in case you accidentally knocked or pulled the brake lever.