One sound, several spellings
English · Key Stage 1 · The School
The same sound, dressed differently
Say these words: "rain", "day", "cake". The vowel sound in the middle is the same in all three, but it is written three different ways — ai, ay and a-e. English does this constantly, and it is the single biggest reason spelling is harder than reading. When you read, you meet the spelling and work out the sound. When you write, you know the sound and have to choose the spelling.
Where each one tends to sit
There are habits, not laws. ai usually sits in the middle of a word: rain, train, paint. ay usually sits at the end: day, play, away. a-e wraps around a consonant: cake, name, made. Knowing the habit narrows the choice from three to usually one, which is most of the work. It does not settle every word, and nobody expects it to.
The long e sound does it too
Listen to "feet", "team" and "happy". Same vowel sound, three spellings: ee, ea and y. Again there are habits — ee and ea sit in the middle, y sits at the end of a longer word. And again the habits are not laws: "key" ends in ey, and it is a perfectly ordinary word.
What to do when you are not sure
Write the word the way you think it goes, then look at it. Does it look like a word you have seen? Readers build a memory of how words look, and that memory is often faster than a rule. If it looks wrong, try the other spelling and compare the two. Checking one against the other is what good spellers actually do — they do not simply know, they try and check. Getting it wrong first and fixing it is the normal route, not a detour off it.