It is recommended to seek medical attention for sunburn if the burn covers a large area of the body, if there are signs of infection (such as pus or fever), or if the burn is accompanied by severe pain, swelling, or blistering.