If dullness or sleepiness overcome your sitting, move to the body and open the eyes wider, or place attention above the hairline or between your eyebrows. If you are still not fresh, rub the eyes or the body. If that still doesn't wake you, stand up and walk, always clockwise. Once you've gone about a hundred steps you probably won't be sleepy any longer. The way to walk is to take a half step with each breath. Walk without walking, silent and unmoving.
If you still don't feel fresh after doing kinhin, wash your eyes and forehead with cold water. Or chant the "Three Pure Precepts of the Bodhisattvas". Do something; don't just fall asleep. You should be aware of the great matter of birth and death and the swiftness of impermanence. What are you doing sleeping when your eye of the way is still clouded? If dullness and sinking arise repeatedly you should chant, "Habituality is deeply rooted and so I am wrapped in dullness. When will dullness disperse? May the compassion of the buddhas and patriarchs lift this darkness and misery."
If the mind wanders, place attention at the tip of the nose and tanden [area just below the navel] and count the inhalations and exhalations. If that doesn't stop the scattering, bring up a phrase and keep it in awareness - for example: "What is it that comes thus?" or "When no thought arises, where is affliction? - Mount Sumeru!" or "What is the meaning of Bodhidharma's coming from the West? - The cypress in the garden." Sayings like this that you can't draw any flavour out of are suitable.
If scattering continues, sit and look to that point where the breath ends and the eyes close forever and where the child is not yet conceived, where not a single concept can be produced. When a sense of the two-fold emptiness of self and things appears, scattering will surely rest.
https://antaiji.org/archives/eng/zzyk.shtml