Update your Raspberry Pi

Update the list of packages

sudo apt update

Then upgrade the packages

sudo apt upgrade

This will ask if you want to upgrade packages.

If you want to upgrade without being prompted, you can add the --yes flag to the command

sudo apt --yes upgrade