I have a challenge: turn Holy Rome into some form of centralized, fully going and united empire. A pack of peanut butter filled chocolate cupcakes to whoever gets it, as I have no idea how to do it.
There are several old threads on the subject.
TL;DR sum up: Get a series of good emperors able to keep things together like the Capets did in France in 1180-1328. The Staufen from Henry VI are a favorite choice.
Hereditary monarchy is a useful step but not strictly necessary.
Obviously, this is only the beginning of a long road, but that's national centralization for you. The best you can hope for is something comparable to OTL England or France - full and complete centralization is beyond the means available for a long time (thanks to issues with communication and travel), but functional centralization is definitely possible with enough work and some luck.