〜ようとする: attempt an action or be about to act
Use the volitional plus とする for an attempt or an action on the verge of starting. Check whether it actually happened.
Connect とする to the volitional
Form 開ける → 開けようとする and 乗る → 乗ろうとする. Conjugate the ending for forms such as the polite past 開けようとしました.
重い窓を開けようとしました。 says someone tried to open a heavy window. The sentence alone does not establish whether it opened.
Catch the moment just before an action
電車に乗ろうとしたとき、電話が鳴りました。 places the phone call just as someone was about to board. It does not place them already traveling on the train.
家を出ようとしています。 can describe being about to leave home. Contrast that immediate situation with a held intention expressed by 出ようと思っています.
Describe unwillingness carefully
弟は野菜を食べようとしません。 describes a younger brother who will not try to eat vegetables. 食べられません instead concerns being unable to eat them.
Describing this attitude can sound critical. If you only mean that the person has not eaten yet, まだ食べていません states that fact.
Quick check: Did the door open in ドアを開けようとしましたが、開きませんでした?
Show the answer and why
No. Someone tried to open it, but it did not open. ようとしました itself does not guarantee success.

