That's a question that would only be answerable by the doctor completing your death certificate.
-The immediate cause of death would be the heart failure (etc) and that would go in Part 1.
-If the certifying doctor believed that diabetes had directly contributed to the heart failure, that would also go in Part 1.
-If the doctor beieved that diabetes had contributed, but only indirectly, that would go in Part 2.
-Conditions present at the time of death, but not contributing, should not be recorded on the certificate.
So the real answers, as with so many things, are "it depends" and "it's a bit more complicated than that".