If onlyの使い方

If only は強い願望を表す表現で、過去、現在、未来の現実に反する文章に使われます。
現在に関する強い願望を表す時には動詞の過去形を使う。
例:If only he knew the truth. (彼が真実を知っていれば良いのに-実際は彼は知らない)
よりフォーマルな文章にするためにwasの代わりにwereを使うこともある。
例:If only she weren’t so tired. (←If only she wasn’t so tired.)
未来についての文章の場合willが過去形wouldに変わる。
例:If only they would talk to each other.(彼らがお互いに話をすれば良いのに)
過去、既に起きたことと反対のことを願う(事実を悔やむ)場合は過去完了を使う。
例:If only Anna had been able to come. (アンナが来れれば良かったのに-来れなかった)
例:If only he had listened to what his friends had been telling him. (彼が友達の言うことを聞けばよかったのに-聞かなかった)
参考元:If only, Cambridge Dictionary