Stars do die. The nuclear fusion reaction in stars stops and the star shrinks into a white dwarf due to gravity. The white dwarf further shrinks by releasing energy and becomes a black dwarf, when no energy is released either by fusion or by shrinking.
The black dwarf can produce gravitational pull, although it cannot generate heat and light. Before the nuclear fusion of hydrogen and helium atoms stops, the highly dense helium atoms fuse again to form beryllium and carbon atoms. The star begins contracting as the fuel gets exhausted. The pressure due to the fusion, which has prevented gravity from shrinking the star, reduces gradually until a black hole is formed.