This is a good guide: https://wiki.tnonline.net/w/Btrfs/Replacing_a_disk
Usually you want to replace drives before they fail (SMART monitoring will give you ample warning in most cases). The it is better to have an additional free SATA port to turn the failing raid temporarily into a three-way raid and use the btrfs built-in function to replace the disk in situ.