9:1 "All this"refers to the general pattern of God's inconsistent retribution that Solomon had discussed. Even though he could not predict whether a given person would experience prosperity or adversity, he believed all people are in God's hand. He sovereignly controls individual destiny, and He may manifest either apparent love or apparent hate toward anyone in this life.
9:2-3 In the sense just explained all share the same fate. No one knows what God may send him or her. "Clean"(v. 2) means ritually clean. Because we do not know what our fate will be we may yield to temptation to sin (v. 3). Everyone experiences both love and hate in his life, though in differing proportion, and everyone eventually dies.
9:4-6 However the inequities in life and the certainty of death should not make us give up living. Life is better than death. In the ancient Near East people despised dogs and they honored lions. It is better to be alive and have no honor than dead and enjoy honor because the living also has consciousness and hope. The living can enjoy life, but the dead cannot.
"The dead do not know anything"does not mean they are insensible. Later revelation indicates that the dead are aware of their feelings, the past, and other things (cf. Matt. 25:46; Luke 16:19-31; et al.). In the context this clause means the dead have no capacity to enjoy life as the living can.
Verses 4-6 do not contradict 4:2-3 where Solomon said the dead are better off than the living. A person who is suffering oppression may feel it is preferable to be dead (4:1), but when a person is dead his opportunities for earthly enjoyment are non-existent (9:4-6).
9:7-9 Again Solomon recommended the present enjoyment of the good things God allows us to experience in life (cf. 2:24-26; 3:12-13, 22; 5:18-19). This was his conclusion since our future on the earth is uncertain and since when we die we cannot enjoy these things. In particular, we should enjoy food and drink (v. 7), clean clothing and perfume (v. 8), and marital companionship (v. 9) among other of life's legitimate pleasures. Note that this list includes some luxuries as well as the necessities of life (cf. 5:19).
"God has already approved your works"(v. 7) means such enjoyment is God's will for us. This encouraging word does not contradict the fact that we are the stewards of all God entrusts to us. However it should help us to realize that it is not sinful to take pleasure in what God has given us, even luxuries. We need to balance gratefulness and generosity, retaining some things and giving away others. This balance is not easy, but it is important.
9:10 Solomon's second recommendation was diligent work (cf. John 9:4). Work is a privilege that we will not have after we die. Probably toil connected with the curse on nature is in view here. We will be active in service in heaven, for example, but this will not be work as we know it now (Rev. 22:3). If you think work is not a blessing, spend some time talking with someone who has been unable to work for a long time.