The du'a is reported in Sahih al-Bukhari 6382, and its meaning is as follows.
"O Allah, I ask You to guide me to what is best by Your knowledge, and I ask You for ability by Your power, and I ask You from Your great bounty. You have power and I have none, You know and I do not know, and You are the Knower of the unseen. O Allah, if You know that this matter [name it] is good for me in my religion, my livelihood and the outcome of my affairs, then decree it for me. And if You know that this matter is bad for me in my religion, my livelihood and the outcome of my affairs, then turn it away from me and turn me away from it, and decree for me the good wherever it is, and then make me content with it."
The wording in the other report adds the words "make it easy for me" and "bless me in it" after "decree it for me" (Sahih al-Bukhari 7390). Both are authentic. The full Arabic text of the du'a is in Sahih al-Bukhari 6382 and it is best to recite it as taught, understanding its meaning. A person who cannot recite it in Arabic may ask Allah in his own language.