Go through these in order and stop at the first one that applies. If you are reading this for someone else, answer for them.
Call emergency services if the baby is difficult to wake, has a seizure, collapses, has severe trouble breathing, develops blue or gray lips or skin, or is very hot and not responding normally.
While help is coming, move the baby out of the heat, remove excess clothing, and follow the emergency dispatcher's instructions.
And for anyone, someone who:
A baby younger than 3 months with a rectal temperature of 38°C (100.4°F) or higher needs prompt medical assessment, even if heat rash seems likely.
For older babies, seek timely advice about fever when the child appears unwell or the fever occurs with a concerning rash.
And for anyone, someone who:
Routine home monitoring is reasonable when a baby otherwise seems well, feeds normally, has regular wet diapers, and the rash starts improving after cooling.
The article also says
Contact the baby's healthcare professional if:
The rash is not improving after several days in a cooler environment.
It continues to spread or repeatedly returns.
The skin becomes painful, swollen, crusted, or filled with pus.
The baby is feeding less, vomiting, or producing fewer wet diapers.
You are unsure whether the rash is heat rash.
The baby has a weakened immune system or another condition that affects temperature control.
Every sign above is quoted from the sofidex article on Babies and heat rashes. If you are not sure, err upward — it is always reasonable to be checked.