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.
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off
# Disable the PWR LED.
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off
Sources: