The mind can affect the body, and the body can affect the mind. They are both conditioned.
With a slight increase in excitement, the heart rate goes up. With relaxation, the heart rate comes down. Stress and anxiety can increase the occurrence of certain medical conditions e.g. gastritis. This is how the mind affects the body.
On the hand, the body can affect the mind. Being ill makes one less energetic. Too much caffeine could make one anxious and jittery. Alcohol can make one heedless.
In my opinion, the sutta relating to Girimananda is not about the supernatural effects of the Buddha's words or powers curing his illness, but rather it is to affect his mind with the Dhamma in such a way, that would sooth and heal the body. I take it here, that the Buddha wants to get the monk to contemplate on these things that helps him to overcome cravings.
From the Girimananda Sutta (translated by Thanissaro):
"Ananda, if you go to the monk Girimananda and tell him ten
perceptions, it's possible that when he hears the ten perceptions his
disease may be allayed.
Which ten?
The perception of inconstancy, the perception of not-self, the
perception of unattractiveness, the perception of drawbacks, the
perception of abandoning, the perception of dispassion, the perception
of cessation, the perception of distaste for every world, the
perception of the undesirability of all fabrications, mindfulness of
in-&-out breathing.
(for details, please read full Sutta)
Then Ven. Ananda, having learned these ten perceptions in the Blessed
One's presence, went to Ven. Girimananda and told them to him. As Ven.
Girimananda heard these ten perceptions, his disease was allayed. And
Ven. Girimananda recovered from his disease. That was how Ven.
Girimananda's disease was abandoned.
A similar question to your's, was asked by householder Nakulapita to the Buddha in the Nakulapita Sutta (below). From here, you can see that the Buddha does not intend to supernaturally heal anybody. Rather, he wants each person to think in this way: 'Even though I may be afflicted in body, my mind will be unafflicted.'
I have heard that on one occasion the Blessed One was living among the
Bhaggas at Crocodile Haunt in the Bhesakala Grove at the Deer Park.
Then the householder Nakulapita went to the Blessed One and on
arrival, having bowed down to him, sat to one side. As he was sitting
there he said to the Blessed One, "Lord, I am a feeble old man, aged,
advanced in years, having come to the last stage of life. I am
afflicted in body & ailing with every moment. And it is only rarely
that I get to see the Blessed One & the monks who nourish the heart.
May the Blessed One teach me, may the Blessed One instruct me, for my
long-term benefit & happiness."
"So it is, householder. So it is. The body is afflicted, weak, &
encumbered. For who, looking after this body, would claim even a
moment of true health, except through sheer foolishness? So you should
train yourself: 'Even though I may be afflicted in body, my mind will
be unafflicted.' That is how you should train yourself."
Later, householder Nakulapita got more detailed advice from Ven. Sariputta the Arahant, elaborating the Buddha's advice:
Ven. Sariputta said: "Now, how is one afflicted in body & afflicted in
mind?
"There is the case where an uninstructed, run-of-the-mill person — who
has no regard for noble ones, is not well-versed or disciplined in
their Dhamma; who has no regard for men of integrity, is not
well-versed or disciplined in their Dhamma — assumes form (the body)
to be the self, or the self as possessing form, or form as in the
self, or the self as in form. He is seized with the idea that 'I am
form' or 'Form is mine.' As he is seized with these ideas, his form
changes & alters, and he falls into sorrow, lamentation, pain,
distress, & despair over its change & alteration.
"He assumes feeling to be the self, or the self as possessing feeling,
or feeling as in the self, or the self as in feeling. He is seized
with the idea that 'I am feeling' or 'Feeling is mine.' As he is
seized with these ideas, his feeling changes & alters, and he falls
into sorrow, lamentation, pain, distress, & despair over its change &
alteration.
"He assumes perception to be the self, or the self as possessing
perception, or perception as in the self, or the self as in
perception. He is seized with the idea that 'I am perception' or
'Perception is mine.' As he is seized with these ideas, his perception
changes & alters, and he falls into sorrow, lamentation, pain,
distress, & despair over its change & alteration.
"He assumes (mental) fabrications to be the self, or the self as
possessing fabrications, or fabrications as in the self, or the self
as in fabrications. He is seized with the idea that 'I am
fabrications' or 'Fabrications are mine.' As he is seized with these
ideas, his fabrications change & alter, and he falls into sorrow,
lamentation, pain, distress, & despair over their change & alteration.
"He assumes consciousness to be the self, or the self as possessing
consciousness, or consciousness as in the self, or the self as in
consciousness. He is seized with the idea that 'I am consciousness' or
'Consciousness is mine.' As he is seized with these ideas, his
consciousness changes & alters, and he falls into sorrow, lamentation,
pain, distress, & despair over its change & alteration.
"This, householder, is how one is afflicted in body and afflicted in
mind.
"And how is one afflicted in body but unafflicted in mind? There is
the case where a well-instructed disciple of the noble ones — who has
regard for noble ones, is well-versed & disciplined in their Dhamma;
who has regard for men of integrity, is well-versed & disciplined in
their Dhamma — does not assume form to be the self, or the self as
possessing form, or form as in the self, or the self as in form. He is
not seized with the idea that 'I am form' or 'Form is mine.' As he is
not seized with these ideas, his form changes & alters, but he does
not fall into sorrow, lamentation, pain, distress, or despair over its
change & alteration.
"He does not assume feeling to be the self...
"He does not assume perception to be the self...
"He does not assume fabrications to be the self...
"He does not assume consciousness to be the self, or the self as
possessing consciousness, or consciousness as in the self, or the self
as in consciousness. He is not seized with the idea that 'I am
consciousness' or 'Consciousness is mine.' As he is not seized with
these ideas, his consciousness changes & alters, but he does not fall
into sorrow, lamentation, pain, distress, or despair over its change &
alteration.
"This, householder, is how one is afflicted in body but unafflicted in
mind."