Upgrade Debian to new version
Upgrade the packages to the latest version available in your current version.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
Edit /etc/apt/source.list and replace your current release name with the latest release name ex :
replace deb https://deb.debian.org/debian/ bullseye main
by deb https://deb.debian.org/debian/ bookworm main
clean package lists
sudo apt-get clean
sudo apt-get update
Then upgrade your packages to the latest release
sudo apt-get upgrade
sudo apt-get full-upgrade
Clean the packages and reboot
sudo apt-get autoremove
sudo reboot