Some thoughts:
Raspbian on the Pi is hopefully as secure as Linux on anything else.
Check the sha-1 hash of the OS images you download.
Have your Pi on a local LAN behind a router that only forwards a few required ports to the machines inside.
Don't have any services running on the Pi you don't need. CUPS, SAMBA, whatever.
Don't run X on any machine that does not need a display.
Don't install Java. Remove any Java installed by default.
Create a new user for yourself on the Pi and remove the Pi user.
Use strong passwords.
Use ssh for remote management. Preferably use ssh keys for authentication. Preferably put a password on he keys. Don't allow root logins over ssh.
Ensure any web server you run on the Pi responds only to HTTPS.
Take all the usual precautions in securing your web services
https://www.owasp.org/index.php/Web_App ... heat_Sheet
Don't go adding weird sources to you /etc/apt/sources.list in order to install software that is not in the Raspbian repos.
Don't install anything from untrusted locations. Like drop box accounts of forum users you don't know and trust.
Do update your packages occasionally.
Do keep an eye on the news in case of security alerts that may call for a package upgrade.
Keep an eye on your logs, like /var/log/auth.log, /var/log/apache2/ ...
Security is not a technology or software or a configuration, it's an ongoing process, a vigil.
Memory in C++ is a leaky abstraction .