を機に goes after a noun for an event and treats it as the occasion for a change: "taking X as the moment to", "when X happened, I…". The event is a milestone – a marriage, a new job, a move, a birth – and the second half is usually a decision. A verb clause takes first.
、。
I quit smoking when I got married.
、。
I moved to Tokyo when I changed jobs.
、。
Now that my child has been born, I'm thinking of saving more money.
A small everyday event does not take を機に: ×雨を機に、傘を買った. Use or for that.
を機に or をきっかけに
names the trigger, whether or not anyone chose it, and it takes small events too. を機に leans towards a choice: the event came, and someone used it as the moment to change something. It also sounds more formal.
、。
I took up tennis because a friend invited me.
、。
When I went abroad to study, I decided to keep a diary every day.
is the formal written version, at home in reports on society and history. を機にして means the same as を機に.
ごれい50、。
A commemorative event was held to mark the company's 50th anniversary.