How can I reduce the high voltage input for 7805?
Two options for you.

Use a step down transformer from your 300V RMS to about 12V RMS, then you can use a half wave rectifier or full-wave rectifier depending on what you have available.


Image source:
https://learnabout-electronics.org/PSU/psu23.php

If you don't have a transformer, then you can go for a cap dropper circuit, which is a transform less power supply topology as shown below, you can replace the zener diode with your 7805 fixed regulator, (Safety hazard present).

The amount current available will depend on the value of your cap, calculations is easy, you just need to find your Xc value and do basic ohm law.

Image source:
https://www.tpub.com/neets/book2/4c.htm
Small cap in the tune of nano-farads will results in higher Xc and less current flowing in from the mains.
Image source:

https://cdn3.astuces-pratiques.fr/imagesarticles/24/alimentation-capacitive-sans-transfo.png
___________________________
WARNING:  All parts of a capacitive dropper circuit must be treated as if they are at full mains potential at all times. Component failure or miswiring can result in full mains voltage appearing at the output. This type of circuit should only be used when the output is fully isolated from user contact.