Your question shows a very well-adjusted approach to a desperately difficult and distressing situation.
The practical answer is that when someone dies at home you should let your GP know at once. They, or someone who is covering for them, will then be able to come and confirm and certify the death. Once this has been done you can then call the undertaker who will not only see to the laying out of your husband's body and all the funeral arrangements but will be able to answer all your questions about what to do next.
Most undertakers do operate a 24 hours service but if your husband dies during the night there is no need for you to call them immediately if you would rather wait for a few hours.
As it is your GP, or one of his or her colleagues, who actually has to confirm and certify death it is important that you make sure they are aware of your husband's situation (the hospital should have notified them but it is best to double check). Ideally it would also help if your husband could visit your GP, or your GP come and visit him at home, once he is back from hospital, if they have not been seeing him regularly.
When your GP confirms the death he or she will give you a medical certificate of the cause of death, together with a slip of paper 'Notice to informant' which tells you about the information you will need to register your husband's death. Your GP would also let you know if a post-mortem was necessary, although this is not usually needed when death is due to cancer.
Obviously even if you know your husband is dying and feel you are managing to cope, the end can still come as a shock and leave you, temporarily at least, confused and bewildered. If you have a friend or relative who you can contact at that time to be with you through those first few hours it might be very helpful.

