"I wrote a letter to my mother yesterday."
Time words, like 昨日, usually go at the start of the sentence, but the main issue is using the particle が after 昨日. が indicates the subject of the sentence so you are saying that "Tomorrow" (as an entity) wrote a letter to "its" mother. 昨日, and other words like 今日 (きょう today) and 明日 (あした tomorrow), don't take any particle after them.
this is wrong, you can actually use a topic marker as は to indicate that it was yesterday that you did the thing
昨日は 母に 手紙を書きました
[as for yesterday][to mom][I wrote a letter]
the only reason why が seems weird is because you don't need to make emphasis on the yesterday, the important part is "the letter you wrote"
A good way to differentiate how to use が and は is to see it as が denotes importance for the things before it while は denotes that the rest of the sentences is more important to the meaning of what the person is trying to say.
Here is a good article for anyone trying to delve in this https://8020japanese.com/wa-vs-ga/
Hmm, I don't think you get it.
You have this construction> お母さんに
the particle に marks where the action takes place, in this case お母さん. And particles in japanese are always behind the nouns they modify. But in english, you reverse this rule and particles are mostly in front of the words like this>
"to mother" ー 「お母さんに」
"for me" －「私にとって」
"in a pub" －「いざかやで」
If you theoretically write this sentence
Then it means something like "I wrote a mother to the letter" which does not make much sense. How do you write a mother? And then you intended to give that written mother to the letter? Uff, sounds like something from Alice in Wonderland.