Is this quote Chanakya translated correctly and where do I find the original quote (work, chapter, verse)?

Before you start some work, always ask yourself three questions—why am I doing it, what the results might be, and will I be successful. Only when you think deeply and find satisfactory answers to these questions, go ahead.

I heard another version of this quote in a YouTube video by Swami Vishwananda. The quote was not cited by Vishwananda himself, but by another guru and went like this:

Whatever you do consider three things: Why? How? What?