dnd 5e – Can the Command spell be used to force someone to drink poison?

It’s up to the DM.

The important bit here in the command spell description is:

The spell has no effect if the target is undead, if it doesn’t understand your language, or if your command is directly harmful to it.

If the affected creature discerns that the command is harmful to it, the spell fails. But how the creature interprets the command is up to the DM.

Command does not charm the target.

This is a reason this plan may not work. Command does not charm the target – they still understand you to be a foe. It seems reasonable that they would be suspicious of the liquid you offer to drink and may determine that it is directly harmful.

Because of this, I would rule that it wouldn’t work, but it would not be unreasonable to rule that it does work. Ask the DM.

After all, the spell description itself says it’s up to the DM:

Some typical commands and their effects follow. You might issue a command other than one described here. If you do so, the GM determines how the target behaves. If the target can’t follow your command, the spell ends.