Q.What is this tree and how can I help it?
My tree has been slowly dying. It hasn’t bloomed flowers in 2 years but this year it has. What can I do to help it regain life? I’m not even sure what it is.

No it’s not that. I’ll try to get a better picture of the flowers.

I'm not able to zoom in on your image. I would say it appears to be a Flowering Crab but can't be 100% without a close up of the flowers and foliage.
This article has more information.
https://www.gardeningknowhow.com/ornamental/trees/crabapple/crabapple-not-blooming.htm