Derrick Walker was 13 years into a mandatory life sentence for crack cocaine possession when his case manager summoned him a few months ago to deliver the news: Soon, he would be going home.

“I ain’t gonna lie, I gave up,” Mr. Walker said in a phone interview from a federal prison in Williamsburg, S.C. “So for me, it was a dream come true at that point.”

Mr. Walker, 37 years old, was one of about 3,100 federal offenders being released starting Friday as part of a sweeping criminal-justice overhaul that President Trump signed into law last year.

The measure, known as the First Step Act, is a major revision of the nation’s sentencing laws that aims to undo the tough-on-crime policies of the 1980s and ’90s that disproportionately affected minorities and filled prisons with nonviolent offenders. It was a victory for a coalition of advocates from across the political spectrum who had pushed policy makers to reconsider harsh sentencing laws as crime rates fell over the past quarter-century.

The Justice Department has begun implementing key aspects of the law, which expands job training and other programs designed to reduce recidivism and help offenders transition back into their communities. Department officials on Friday unveiled a centerpiece of the law, a risk and needs assessment through which federal inmates will be evaluated to see what programs and treatments could help reduce their risk of re-offending. Those who successfully complete programs can earn credits that will expedite their release.