[verb て-form] + おく [verb て-form] + おく → 〜とく / 〜どく (casual)
ておく means doing something now so that it is ready for later: "do in advance", "get ~ done". It follows the て-form of a verb you do on purpose – かう買う, しらべる調べる, but also やすむ休む or ねる寝る – and おく then changes like any う-verb: ておきます, ておいた, ておこう.
With a verb that changes a state, ておく can mean leaving it that way on purpose.
ておく is the action, done by someone for a purpose. てある is the state it leaves behind, with the thing as subject on が. Both take the transitive verb; the intransitive partner – ひらく開く for あける開ける, つく for つける – takes neither.
These go beyond preparing in advance.
ておく can also mean doing something for the time being without settling the matter. かんがえて考えておきます, "I'll think about it", is often a polite no.
In speech ておく shortens to とく, and でおく to どく: しとく, よん読んどく, いっ言っといた.