This is the 52nd most frequent Croatian word.
bili
"Bili" in Croatian means "were" (past tense of "to be").
Here, 'bili' is the masculine plural form of the past auxiliary verb used in past tense formations with the main verb to indicate that 'they' (plural) were happy.
Ljudi su bili sretni.
The people were happy.
In this question, 'bili' is again the past auxiliary verb in its masculine/mixed-gender plural form, used with the subject 'they' to ask about their presence at school in the past.
Da li su oni bili u školi?
Were they at school?
In this case, 'bili' is the first-person plural form of the past auxiliary verb, indicating that 'we' were at grandmother's place yesterday.