When you activate a ProximityPrompt, it gives you their player instead of their character. To find the humanoid, you have to get their character and see if it exists, then find the humanoid (and check if it exists). If you get through all those checks, you can damage the humanoid.
part.ProximityPrompt.Triggered:Connect(function(player)
local char = player.Character
local hum = char and char:FindFirstChild("Humanoid") -- If the character exists, try to find its humanoid and put it in this variable.
if hum then
hum.Health = 0
end
end)