The Islamic legal method of forcing someone to do something is to imprison them until they agree to do it. The punishment for runaway slaves as mentioned in Hidayah:
When the runaway is brought to the sultan, he is to imprison him, but
if the lost slave is brought to him he is not to imprison him. The
reason is that he cannot be sure that the runaway will not run away a
second time, as distinguished from the lost slave.
And in general, allowance to imprison a slave (quote from old translation of Hidayah):
A master must not fix an iron collar on the neck of his slave. It is
abominable for a person to fix an iron collar on the neck of his slave
in such a manner as to deprive him of the power of moving his head,
according to the custom of tyrants ; because a punishment of this
nature is like the torments of the damned, and is consequently
unlawful, in the same manner as scorching with fire.
But he may imprison him. A Muslim may imprison his slave; for as a
custom prevails amongst the Muslims of confining people who are mad or
seditious, so in a similar manner it is lawful for a person to confine
a slave, that he may prevent his absconding, and thus secure his
property.
Torture, branding, killing and starving are not allowed.
Abu Mas'ud al-Badri reported: I was beating my slave with a whip when
I heard a voice behind me: Understand, Abu Masud; but I did not
recognise the voice due to intense anger. He (Abu Mas'ud) reported: As
he came near me (I found) that he was the Messenger of Allah (ﷺ) and
he was saying: Bear in mind, Abu Mas'ud; bear in mind. Abu Mas'ud. He
(Aba Maslad) said: threw the whip from my hand. Thereupon he (the Holy
Prophet) said: Bear in mind, Abu Mas'ud; verily Allah has more
dominance upon you than you have upon your slave. I (then) said: I
would never beat my servant in future. [ Sahih Muslim ]
Abu Huraira reported Allah's Messenger (ﷺ) as saying: When the slave
of anyone amongst you prepares food for him and he serves him after
having sat close to (and undergoing the hardship of) heat and smoke,
he should make him (the slave) sit along with him and make him eat
(along with him), and if the food seems to run short, then he should
spare some portion for him (from his own share) - (another narrator)
Dawud said:" i. e. a morsel or two". 4097 [ Sahih Muslim ]
Narrated Al-Ma'rur: At Ar-Rabadha I met Abu Dhar who was wearing a
cloak, and his slave, too, was wearing a similar one. I asked about
the reason for it. He replied, "I abused a person by calling his
mother with bad names." The Prophet said to me, 'O Abu Dhar! Did you
abuse him by calling his mother with bad names You still have some
characteristics of ignorance. Your slaves are your brothers and Allah
has put them under your command. So whoever has a brother under his
command should feed him of what he eats and dress him of what he
wears. Do not ask them (slaves) to do things beyond their capacity
(power) and if you do so, then help them.' " [ Sahih Bukhari ]