Preet Bharara, U.S. attorney for the Southern District of New York, urged Harvard Law graduates at the 2014 Class Day ceremony not to squander the precious and powerful gift of their Harvard Law degrees.

“The power of your degree gives you a degree of power that few possess, few know how to use, and fewer still know how to put to good purpose,” he said.

Lawyers have a power unmatched in society to promote liberty and preserve equality. “People spend their entire lives waiting for the chance to do something meaningful to make a difference in the world,” Bharara said. For many people, that moment never comes, but for HLS grads, they will have that opportunity every day. “I hope and pray you will seize it. The world needs you to seize it.”

Bharara was one of two speakers at the May 28 Class Day. He spoke alongside comedian, writer and actress Mindy Kaling, who like Bharara is Indian American. “Apparently it’s India Day,” Bharara joked. “I hope you enjoy the lamb vindaloo and the chicken tikka masala to be served after.”

Watch Preet Bharara’s Harvard Law School 2014 Class Day speech:

Bharara, known for prosecuting insider traders, international terrorists, and corrupt public officials, said he wanted to speak to graduates about how to be successful and happy as a lawyer. Nothing matters more, he said, than doing your job and doing it well every day, “even when no one is looking.” If you do that, he said, “your entire career will take care of itself.”

He drew a lesson from Major League Baseball four years ago, when Roy Halladay of the Philadelphia Phillies pitched a perfect game. Four months later, he pitched a no-hitter in the playoffs.  When asked what advice he had given Halladay, his pitching coach said he told him “ to go out there and try to be good.”  Bharara called that the best advice he had every heard. “If you just go out there and try to be good, you have a chance to be great,” he said.

Being good is not easy for Harvard Law grads, who have a tendency to think they have to pitch a perfect game every time.  Even so, he said, you have to do it one pitch at a time. “That’s what develops into a perfect game or by analogy an outstanding career,” he said.

Along the way, he advised graduates to be humble. “Humility is important so you don’t become unbearable, and it will keep you open minded and striving to always do better. “

Every day he goes to work, Bharara said he walks past 100 years of U.S. attorneys’ portraits. “They appear to be telling me every morning, ‘Don’t screw up, kid.’” That fear motivates him. “I still have self confidence,” he said, but also roaring self doubt. “Self doubt is my friend, and arrogance is my enemy.”

He cautioned graduates to be prepared to accept criticism, because it will come – especially if they rise high or take a stand on something. The key to accepting criticism, Bharara said, is knowing which criticisms are well placed and which are foolish.

His own public career has come with criticism from many and unexpected places. He recounted being severally criticized in India when his office prosecuted a mid-level Indian diplomat for visa fraud and mistreating a domestic worker. Indian talk shows pilloried him for being a self-loathing Indian seeking favor with the American establishment. “As the accusations got more and more absurd, they became downright comical, and I got some of my perspective back,” Bharara said, recalling one journalist who accused him of having undertaken the case “to serve his white master.”

Presumably that meant Eric Holder and Barack Obama, Bharara said. “That is an example of criticism that is stupid.”

In closing, Bharara noted the news that author and poet Maya Angelou had passed away that morning. He recalled her words that no one should go through life with a catcher’s mitt on both hands, because “you need to be able to throw something back.”

“Try to be good,” Bharara said. “Do it one pitch at a time. And don’t forget to throw something back. The world is waiting for all of you. Good luck!”