Auxiliaries of regret and peace of mind with てしまう and ておく
てしまう indicates that something is "complete" or "done completely". It's also used when things "end up" in such a "complete" state, like after mistakes. A good way to remember this is to think about "it's done" and "now I've done it". It can often have a nuance of regret.
てしまう can also be ちまう or ちゃう in speech (or じゃう for voiced verb conjugations like 死んでしまう -> 死んじゃう).
私はあっという間に全部食べてしまった。 I ended up eating all of it in the blink of an eye. 私は死んでしまったみたいです。 It looks like I died (lit: ended up dead)
Once something is done with てしまう, the implication is that it cannot be taken back.
ておく means to do something and then leave it untouched/leave it alone with the expectation that it will bear fruit in the future. This is often described as “do something in preparation” because practically speaking that’s what it often implies. It can also be used metaphorically to mean “do something and then put it out of mind”. ておく is often contracted as とく
まず最初に言っておきたいことがある。 First, there is something I need to tell you. 俺はただ知っておきたいだけなのだ。 It's just that I simply want to know it (= for my own peace of mind)