[verb (dictionary form)] + べく する → すべく / するべく
べく means "in order to": the clause before it is the goal, and the clause after it is what someone does to reach it. It follows the dictionary form of a verb, and する usually becomes すべく. It belongs to writing, news reports and formal speeches; in conversation the same sentence uses ために.
ために says the same thing in any register. べく adds a note of resolve and sounds written; said to a friend, it sounds stiff.
べく takes only a verb. ために can also follow a noun with の, べく cannot.
The goal has to be something the subject sets out to do. A clause about something nobody controls does not go before べく.
The clause after べく reports what someone did or does. A request or an order cannot follow it.