Use the tip of a spudger to gently push the speaker cable connector out of its socket horizontally, alternating pushing either side of the connector out a little bit at a time.
Use an opening tool to pry the loudspeaker assembly up slightly from its recess in the phone.
Hold the silver charging assembly cable out of the way while you're working, but be careful not to bend it too far or apply too much strain where it connects to the charging assembly.