From the article "Two Exercises for Turning Intention into Motivation" by Thupten Jinpa on Buddhist site tricycle.org, we see some useful tips on how to motivate yourself to do a task that you set yourself to do.
He states that "parents who have struggled with their child taking up a new instrument will recognize how everything changed the moment the child began enjoying it." Basically you need to find a way to enjoy what you're doing - this is intrinsic motivation. When you enjoy it, the rest comes naturally.
You can try the two exercises on this page.
The question of how we motivate ourselves to pursue our deeper
aspirations has been a major interest in the long history of Buddhist
psychology. In Buddhist thinking, motivation is a matter of desire,
more specifically the desire to act accompanied with a sense of
purpose. Say, in the case of being more compassionate, it’s by making
emotional connection with compassion and its objectives that we arouse
in ourselves the desire to act. And it’s through seeing the benefits
that we acquire a sense of purpose in being more compassionate.
Contemporary psychology has only relatively recently come to
appreciate the role of emotions in motivating our behavior. For a long
time, the Western theory of action was dominated by rational choice
theory, and emotions were accused of clouding the process rather than
being an integral part of the system. To articulate the dual dimension
of our motivation—cognitive awareness of and emotional connection with
our goals—Buddhist psychology uses a term that is almost impossible to
capture in any single word in English. The Sanskrit term shraddha
(depa in Tibetan) has a broad range of meaning, the important ones
being “faith,” “trust,” “belief,” or “confidence,” connoting
“appreciation” and “admiration” as well. Shraddha is a felt sense like
trust, rather than a cognitive state like belief or knowledge.
Experientially, shraddha feels something like attachment or attraction
to our goal, like being inspired to play guitar when you see a rock
star do it. It’s this quality, shraddha, that primes our heart and
mind to roll up our sleeves and play.
How do we tap our emotional reservoir? Cognitions play a critical
role, which the early Buddhist texts characterize as seeing the value
of doing something. Through cognitive engagement, such as seeing the
benefits, we connect intention with motivation. So, within this causal
nexus, the crucial link to watch for is the one between our awareness
of the goal and why we would go for it, our feelings about the goal,
and our desire or will to pursue it.
Then, again, it’s the joy we take in our efforts—the courage to try,
the dedication to stick with it—and their results that helps sustain
our motivations over the long run. Or, in other words, makes us want
to keep trying and keep doing it. Parents who have struggled with
their child taking up a new instrument will recognize how everything
changed the moment the child began enjoying it. This is called
intrinsic motivation, as opposed to the extrinsic motivation of, for
example, the parent rewarding the child with more screen time for
practicing her instrument. From decades of motivation research, we
know that intrinsic motivation is far more stable and enduring. The
process of setting intentions and joyfully reflecting on them in
dedication is how, over time, we transform extrinsic into intrinsic
motivations, and thereby sustain the energy and purpose to live true
to our best aspirations.