Sometimes it is a bit of trial and error in knowing if they are hungry or in pain from teething, but one way you can tell is if they return to sleep by being comforted by you.
Thank you for submitting your tip! Look out for your tip on this site in the future.