All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
First of all we ask Allaah to magnify your reward, make better your solace and make your son intercede for you on the Day of Resurrection, and may He grant you with another child better than him.
You have to know that Allaah has decreed the destiny of everything before he created the heavens and the Earth, and He knows what happened and what will happen, and He decreed all of this. Allaah says (which means): {Do you not know that Allaah knows what is in the heaven and earth? Indeed, that is in a Record. Indeed that, for Allaah, is easy.}[Qur'an 22:70]. Allaah further says (which means): {No disaster strikes upon the earth or among yourselves except that it is in a register before We bring it into being, indeed that, for Allaah, is easy.}[Qur'an 57:22]. Moreover, the Prophet said: "Allaah has decreed the destiny of all the creatures 50,000 years before He created the heavens and the Earth.'' [Muslim] The causes and the consequences are included in this predestination.
The death of this boy was predestined by Allaah, and a calamity could be a mere affliction from Allaah to His Servants, so if a person is patient and seeks the reward from Allaah for his hardship and calamity, Allaah will forgive some of his sins and reward him greatly. The Prophet said: "Allaah says: "The reward of a believing person from whom I take the soul of his beloved one from this world, while he seeks My Reward, is nothing but
Therefore, we advise you to be patient and show this patience in front of your four-year old son so that he will be patient. You should occupy him with what would prevent him from mourning him.
Finally, we have to look at whether or not his father caused the death of his son. If his father took all safety precautions and was not negligent then he is not sinful, but if the accident occurred due to some negligence from his part, then he has to pay a Diyah which is blood-money (compensation) that has to be paid by his family and he will not inherit anything from it.
Secondly, he has to expiate for accidentally killing a person, which is to free a believing slave or fast two consecutive months.
Allaah knows best.