If you're using an external monitor, it's better to do it on the monitor itself rather than in software. When you do it on the monitor it applies everywhere, even when rebooting or using another OS. When I did it in software (redshift) I noticed it was causing my laptop to overheat.
Here's how I do it on Linux with a Dell U2720Q monitor.
sudo apt-get -yy install ddcutil # Install ddcutil on Ubuntu
sudo modprobe i2c_dev # Load required kernel module
# Night - Set brightness to 20% and color temperature to 3000K
sudo ddcutil setvcp 10 20
sudo ddcutil setvcp 1a 43
sudo ddcutil setvcp 18 69
sudo ddcutil setvcp 16 100
# Daytime - Set brightness to 50% and color temperature to 6500K
sudo ddcutil setvcp 10 50
sudo ddcutil setvcp 1a 100
sudo ddcutil setvcp 18 100
sudo ddcutil setvcp 16 100