Is there a sutta suitable for monastics or laypeople, that helps one become motivated when one is having a hard time disciplining themselves?
By "discipline" I'll assume you mean "training" yourself, i.e., trying to establish a "pleasant and profitable" new habit. I hope you don't mean "punish" because that's torture and pain, a path that the Buddha abandoned.
Motivation occurs by seeing things clearly and seeing the long-term value in the thing that you want to gain. When you see things clearly in this way, you "Instruct, rouse, urge and encourage" (the Buddha's phrase) yourself to act in order to gain the result.
It can be helpful also to see clearly what's holding you back. If we just say, "I'm just lazy", or it's just sloth and torpor holding me down, that's pretty vague. What can you do about that?
But if you look at how the Buddha describes the four Courses of Action, you may see your problem in the second of the four courses. That's one of the ones that everybody has trouble with: Doing what may be, or may seem unpleasant, but is profitable (will be for your long term welfare and happiness).
If that's the case, then you might start to see that maybe the problem is not with the thing (that you're not doing, or not doing enough of), it's with the suffering that you're creating now by the unskillful way that you're thinking about it. That's what's pushing you in the wrong direction, a sort of anti-motivation (inappropriate attention, leading to unskillful intention / karma, and unhappiness).
I have found the four Courses of Action insightful, and reflecting on them an inspiring way to motivate myself.
Nike: "Just Do It". But that doesn't mean running around like a moron doing whatever you feel like, Buddhists do it skilfully, in the middle way.
Yes, the famous lute or harp string analogy is useful here.
The Buddha said to him, “Soṇa, as you were in private retreat didn’t this thought come to your mind: ‘I am one of the Buddha’s most energetic disciples. Yet my mind is not freed from defilements by not grasping. But my family has wealth. I could enjoy that wealth and make merit. Why don’t I resign the training and return to a lesser life, so I can enjoy my wealth and make merit?’”
“What do you think, Soṇa? When you were still a layman, weren’t you a good player of the arched harp?”
“When your harp’s strings were tuned too tight, was it resonant and playable?”
“When your harp’s strings were tuned too slack, was it resonant and playable?”
“But when your harp’s strings were tuned neither too tight nor too slack, but fixed at an even tension, was it resonant and playable?”
“In the same way, Soṇa, when energy is too forceful it leads to restlessness. When energy is too slack it leads to laziness. So, Soṇa, you should apply yourself to energy and serenity, find a balance of the faculties, and learn the pattern of this situation.”
“Yes, sir,” Soṇa replied.