To replace the battery in a MacBook, unscrew the two screws on the inside edge of the battery using a tri-wing Y1 screwdriver. Unplug the old battery and replace it with a new one, securing it with the screws.