@chrisdelica
The translation of this would depend on: 1) whether it is being said based on a specific experience of the speaker/teacher; or 2) whether it is a general statement about teaching kids in the past compared to the present; and 3) what "earlier" really means.
"Earlier" in English may refer to any time before the present. There is no word in Tagalog that can give that exact meaning. In Tagalog, there is "kanina" which means "earlier today". If it's about a recent past, we specify if it's, for example, yesterday, two days ago, last week, last month, etc. If it's "before" as in "a long time ago" , then the word is "dati".
If the speaker is only talking about his own experience and "earlier" is "earlier today":
Nahirapan akong turuan ang mga bata kanina = I had a hard time teaching the kids earlier today. ("Naturuan" is object-focused, subject is the object "kids". )
or
Nahirapan akong magturo sa mga bata kanina = I had a hard time teaching the kids earlier today. ("Magturo" is subject-focused, subject is "I", the actor.)
If this is a factual comparison between teaching experiences in the past and the present:
Mahirap turuan ang mga bata dati = It was hard teaching kids in the past ("Turuan" is object-focused, subject is the object "kids").
Mahirap magturo sa mga bata dati = It was hard teaching kids in the past ("Magturo" is subject-focused, subject is the unmentioned teachers).