First, if grandpa is dying, the leader will still arrange for you to work overtime on weekends. I think you should communicate with leaders or superiors as soon as possible, tell grandpa that you are dying, emphasize family emergency, and hope to get understanding and support. Try to stay calm and rational when communicating with leaders, so as to effectively express your troubles and needs. In order to find a mutually acceptable solution, it is very important to actively communicate with leaders.
Second. Provide reasonable explanations to the leaders. Explain clearly how overtime affects you. You can explain to the leader that because your grandfather is seriously ill, you need to help your family handle affairs and participate in care and support, and your absence will bring you great trouble. While asking for leave from the leader, you put forward an alternative plan to ensure that your work will not be greatly affected. For example, you can suggest that the leader arrange for other colleagues to take over your work.
Third, meet grandpa and arrange for you to work overtime on weekends. If the leader still insists that you work overtime, you can consider asking colleagues, friends or family members for help. They may be willing to help you share some of the workload. If you can't ask for leave, or get help from others, try to discuss with the leader the adjustment of work priorities, so that you can arrange your time reasonably and take care of your dying grandfather on the premise of ensuring the completion of the work as much as possible.