"Kabla ya shule"
I still don't understand the use of "ya"... Would" kabla shule" be correct? Someone explain please
You have to have the full expression "kabla ya". Prepositions are kind of random in lots of languages, but some English examples that require more than one word are: "because of", "instead of", "on top of", and "next to".
It just so happens that the concept before is expressed as one word in English and two words in Swahili.
There is an 'a' of association - wa, ya, cha, za, for example, in every Kiswahili noun class - MA-WA, M-MI, JI-MA, KI-VI, and so on. The nouns and their 'a' association have to be memorized for each class, I'm afraid. I don't know of any short cut.