ANSWER:
The first thing to be taken from the wealth of the deceased is the cost of his funeral. After that, we must calculate and give out all his debts whether to people or to others.
Zakat is a debt upon him to Allah and it must be calculated and given out before distributing his wealth to the heirs.