As I'm studying these prepositions to be used in the ablative case, I had a question. How do you know when to use a (with a macron) verus ab? What about e (with a macron) versus ex? Thanks for your explantion!

You already know how to differentiate between using "a" and "an" in English, right?

It's the same with these two: it depends on whether the immediately following word begins with a vowel or a consonant.