To install a package (like nvi):
$ doas pkg_add nvi
To delete a package:
$ doas pkg_delete nvi
To delete unused dependencies:
$ doas pkg_delete -a