Jesus fully expected His disciples to fast. Therefore, He did not command it, but He taught us how to do it,
“Moreover, when you fast, do not be like the hypocrites, with a sad countenance. For they disfigure their faces that they may appear to men to be fasting. Assuredly, I say to you, they have their reward. But you, when you fast, anoint your head and wash your face, so that you do not appear to men to be fasting, but to your Father who is in the secret place; and your Father who sees in secret will reward you openly” (Matthew 6.16–18).
Do not fast to show men how religious and righteous you are, but to show your devotion to our heavenly Father.