There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
I think you might need to consider a manual reconstruction - I am not aware of any tools that will do this but based on what you have told me it sounds like it might be a one way function. I did do a minimalist search to see if I could find anything but as you stated in the OP lots about HTML to Master Page - not so much the other way around.
I suggest you delete this post and try again just in case there are experts who will pick it up the second time around - I doubt they will but it can't hurt. I don't think I can contribute anything more at this stage.