For example, given the reaction below:
The substrate is secondary, the solvent is aprotic and it is to react with a strong bulky base. From this, I assumed that the reaction would be $\ce{E2}$. However, it instead begins with an acid-base reaction where the tert-butoxide removes the proton of hydroxide and then proceeds with a $\ce{Sn1}$ reaction where the oxygen attacks the carbon of the leaving group to form an epoxide.
How can you determine if an acid-base reaction will take place before proceeding with a substitution reaction?