〜ようとする This pattern is used to say that someone tries to do something, or is just about to do it. In the past tense it often means the attempt failed or was interrupted.
Formation
volitional form + とする
| 寝る | 寝よう | 寝ようとする |
| 出る | 出よう | 出ようとする |
| 思い出す | 思い出そう | 思い出そうとする |
Examples
寝ようとしたとき、電話がかかってきた。
Just as I was about to go to sleep, I got a phone call.
名前を思い出そうとしたが、思い出せなかった。
I tried to remember the name, but couldn't.