Once the new cable is on, you use the cable adjuster on the handlebar lever to take slack out.
Back it out until the brake is grabbing a little then turn it back in until there is a little play in the lever.
Turn the rear wheel by hand and work the handlebars from lock to lock. Make sure the brake doesn’t engage. Then use the lock but to secure the cable adjuster.