[verb (volitional)] + とする [verb (volitional)] + とした + が / とき [verb (volitional)] + としている [verb (volitional)] + としない
とする after the volitional form of a verb means "try to" or "be about to": the action is attempted or on the point of happening, but has not yet been carried out. The volitional is the 〜う / 〜よう form – あけよう開けよう, いこう行こう, しよう, こよう来よう.
The verb must be volitional: ×開けるとする, ×開けてとする. In the past, ようとした usually means the attempt failed or was cut short, and the sentence goes on to say how.
With とき時, ところ or しゅんかん瞬間, ようとした marks the moment just before an action, when something else cuts in. In the ている form it says something is on the point of happening, and the subject can be a thing as well as a person.
With a person or an animal, ようとしている can also be "trying to", and context decides.
The negative ようとしない says someone refuses to do something, or makes no effort to. It describes another person's attitude, so it is rarely used about yourself.