The following lines of code will help you turn off the power and activity lights from your Raspbery pi 3 B+. Note: this code worked with one of my raspberry pi’s and not on the other. I still need to see why.
Enable editing of the /boot/config.txt file
sudo mount -o remount,rw /boot
Disable LED’s –> Add the following to the config.txt file
# Disable the ACT LED.
# Disable the PWR LED.