Settled first, before faraid
Before distribution, the estate must cover funeral costs, the deceased's debts, and any bequest (wasiyyah, capped at one-third). A surviving spouse's share of jointly-acquired property (harta sepencarian) is also separated out first. Enter the net estate after these.