There is a way but this would mean it won’t be accessible from outside. You’ll only be able to login from your console, are you sure this is what you want?
If yes, then the way to do is
As soon as you are in, you’ll need to rename the file /etc/network/interfaces. To do so you can do the following
mv /etc/network/interfaces /etc/network/interfaces-old
Then you’ll need to restart your network service
As soon as you do this, you’ll be able to access the droplet only via the console.
Alternatively, I believe what you are aiming to do is cut off access to your droplet but to your self via SSH, is that correct?
If it is, you’ll just need to close your ports 80 and 443 to do so.