Always consult a pediatrician for any pain, preferably by telephone; in the event of worsening pain and other symptoms, call an ambulance immediately or see your pediatrician. In children, their health can deteriorate rapidly, there is no need to wait unnecessarily.
Make a list of the foods your child has been consuming for the last hours / day for the doctor, and a list of drinks and medicines you have given him / her. Think about the possible cause of the pain (tooth growth, bloating).