How to target player with the lowest health? [duplicate]

Quijibo has a good idea, and I would like to take this opportunity to expand it into an official answer.

First, you need a free tag name that will be applied to the player to target. I'll be using lowestHealth as my tag. The tag will be applied to the player with lowest health, using the nearest player if there's a tie.

Place down an impulse command chain consisting of 20 command blocks.

Insert the following commands into each command block.

  1. Remove the tag from all players.

    /tag @a remove lowestHealth
    
  2. At your position, add the tag to the nearest player with health 0.

    /execute as YOUR_USERNAME at @s run tag @p[scores={health=0},name=!YOUR_USERNAME] lowestHealth
    
  3. If the tag has not yet been applied, target the nearest player with health 1.

    /execute unless entity @a[tag=lowestHealth] as YOUR_USERNAME at @s run tag @p[scores={health=1},name=!YOUR_USERNAME] lowestHealth
    
  4. If the tag has not yet been applied, target the nearest player with health 2.

    /execute unless entity @a[tag=lowestHealth] as YOUR_USERNAME at @s run tag @p[scores={health=2},name=!YOUR_USERNAME] lowestHealth
    
  5. If the tag has not yet been applied, target the nearest player with health 3.

    /execute unless entity @a[tag=lowestHealth] as YOUR_USERNAME at @s run tag @p[scores={health=3},name=!YOUR_USERNAME] lowestHealth
    

Continue with commands up to health 20.

  1. Run whatever command you want with the tagged person. For example...

    /tellraw @p [{"text":"You have the lowest health! Be careful..."}]