Depending if you're the root user or not -- (use sudo if not root user), (no need for sudo if root user). I usually just do
pkg update -f
pkg upgrade
This installs all upgrades that were installed through the package system
Ports can be upgraded a bunch of different way, however if you've installed portmaster, I just usually do
portsnap fetch extract
portsnap fetch update
portmaster -a