Hitler designated Hermann Göring, who was already the second most powerful man in Nazy Germany - commander-in-chief of the Luftwaffe, among many other titles - as his successor as Fuhrer of Germany, first in a speech on the first day of the war in 1939, and them formally in a decree in 1941. Göring was also promoted to Reichsmarschall by Hitler in 1940, making him the highest ranking soldier in all of the German Armed Forces. This gives you an idea of how highly Hitler regarded Göring during the years leading up to and including the first few years of the war.
At the end of the war in April, 1945, with Berlin surrounded, Hitler informed the rest of the German High Command that he would be staying in Berlin until the end, at which point he would commit suicide. Göring apparently took this as meaning that Hitler was finished, and that even though he was still alive in his bunker in Berlin, it was time for Göring to officially assume command. He sent a telegram to Hitler on April 23 asking if this was the case, and that if he did not hear back by 22:00 that night, he would assume command of the Reich. This made Hitler furious, and he accused Göring of treason, stripping him of all his rank and titles a few days later. The day before his death, on April 29, Hitler issued his last will and testament, naming Grand Admiral Karl Dönitz, commander-in-chief of the German Navy, as President of the Reich and Supreme Commander of the Armed Forces. Dönitz authorized the unconditional surrender of Germany shortly after.
Edit: Below is an English translation of Hitler's last will and political testament, where he specifically references both his speech and decree that Göring should succeed him, and also states that he is canceling these orders.
The plan for succession was that Hitler and only Hitler would decide, basically by decree, who his successor would be, when or if he ever chose to. I believe that was the extent of the 'formal' process. Hitler would say 'you' and you would be it. There was nothing concrete in place in case of a sudden death as far as I'm aware, though it may have been that the next in line would have been the next highest ranking member of the party which I think was Goring.
At least, general consensus between most of the top brass in the third Reich is that the leadership would have fallen to one of Himmler or Goring should Hitler have ever stepped down or died. But the factious in fight that did go on and would have gone on had that happened would have been pretty huge. However in the closing days of the third Reich, Goring had assumed Hitler was staying in the bunker to die and assumed he could take over the leadership and asked him for permission, and Himmler had attempted to broker a peace deal with the Western Allies, Hitler took both as a gross betrayal and had them kicked out of the party.
It was not known who would take over at that point. Bormann and Goebbels were in the bunker with Hitler and Hitler probably assumed both would take their life (Goebbels did, Bormann fled and died tried to escape Germany). Hess had fled to England and Hitler believed he had lost his mind. He had believed the entire Wehrmacht had betrayed him and by the end had not many people he believed were still loyal to him. He turned to the Admiralty who he believed were the only arm of the German forces who had performed to his satisfaction and thus Donitz was picked. And after looking into it I think Raeder had been taken prisoner by the Soviets, so Donitz was now in charge of the Navy
In any case, it was a mess of a line of succession. This ambiguousness probably helped a lot of men below Hitler become extra callous as the war went on in an attempt to be noticed by and impress Hitler. It certainly helped increase the sycophantism that you see in the top brass of the party through the likes of Hess, Goebbels, Bormann et al.
Interesting interview with Donitz in 1973: https://www.youtube.com/watch?v=D505WKDrrHM