Writing systems

A writer chooses between two spellings that sound the same but have different conventional meanings. Which information is most useful for choosing correctly?