Use the adverb certainly when you’re sure about a particular action — absolutely, positively sure. If you love the new shoes you just bought, you may defend your purchase by saying they were certainly worth the money you paid.
The word certainly emphasizes that you’re positive about something. When you hear thunder and look up at a gray sky, you might say it will certainly rain. If you’re on a diet, you could say that you will certainly avoid chocolate cake. Certainly can also be used to answer a question in the affirmative. If your boss asks to speak to you, you might answer, “Certainly.” It’s just a formal way of saying “yes.”