They are adverbs that mean "as much as possible". They are used when describing situations in which you try to do something as much as you can.
"なるべく[narubeku]" is a synonym for "できるだけ". They are interchangeable in many cases, but the nuance is slightly different.
"なるべく" indicates that you do something to the extent possible depending on your situation or your ability.
"できるだけ" indicates that you make the utmost effort to do something despite of your situation or ability.
毎日日本語を勉強するのは大変だけど、なるべく(勉強)しようと思う。
毎日日本語を勉強するのは大変だけど、できるだけ(勉強)しようと思う。
- Ken: It didn't go well. Hmm, I did everything I could, but I couldn’t solve some problems. I might not pass the exam.
ダメだった。んー、できるだけの事はやったけど、何問か解けなかった。落ちるかも。
---> In this case, he can't use "なるべく" because he made the upmost effort to pass the exam. - Leo: Don’t let it get you down until you get the result of the exam.
- 結果が出るまで、落ち込むなよ。
- Ken: Thank you. I'm so tired. I want to leave as soon as possible. There is no rush for work to be done, right?
ありがとう。すげー(=すごい)、疲れた。なるべく(orできるだけ)早く帰りたい。急ぎの仕事は、そんなにないよね?
---> In this case, he can use "なるべく" and "できるだけ" depending on his feelings. But I think "なるべく" is better because he may have to work a lot, so he should hesitate to make the request. - Leo: Yes, you can go home and rest as much as you can. We’ll get busy starting tomorrow because that’s when the new project starts.
うん。帰って、できるだけ(orなるべく)ゆっくり休んで。新しいプロジェクトが始まるから、明日から忙しくなるよ。
---> In this case, he can use "なるべく" and "できるだけ" depending on his feelings. But I think "できるだけ" is better because he can emphasize his opinion that Ken should rest a lot.