The easiest way to check what's going on on you VM go to Compute Engine
-> VM instances
-> click on NAME_OF_YOUR_VM -> at the VM instance details
find section Logs and click on Serial port 1 (console)
and there you'll find a lot of log messages where you should search mainly for "No space left" errors. As you can find at the documentation Handling the "Could not connect, retrying..." error:
The boot disk of the instance has run out of free space. When the
connection is established, the guest environment updates the
~/.ssh/authorized_keys file with the public SSH key used for the
current session. If the disk runs out of free space, the update fails.
To identify issues with disk space, check the serial console output of
the instance and look for "No space left" errors.
If you found "No space left" error messages follow these instructions:
- Resize the boot persistent disk of the instance to increase its size. If the operating system image used by the instance supports
automatic resizing, this is the easiest option because the
operating system automatically resizes the root partition to match
the new size after the instance is restarted.
- If you know which files are using the disk space, create a startup script that deletes the unnecessary files and frees space for the
instance to start. Restart the instance so that the script executes
and cleans the files. Be careful to use the correct command and
delete the correct files. After your instance starts and you are able
to connect to the instance through SSH, set the startup-script
metadata item back so it does not continue to delete the files.
- For information about how to access the instance's disk, see General tips for using Compute Engine.
and in some cases you should follow Recovering an inaccessible instance or a full boot disk guide:
If an instance is completely out of disk space or if it is not running
a Linux guest environment, then automatically resizing your root
filesystem isn't possible, even after you've increased the size of the
persistent disk that backs it. If you can't connect to your instance,
or your boot disk is full and you can't resize it, you must create a
new instance and recreate the boot disk from a snapshot to resize it.
step by step instructions you can find here.
If your problem isn't related to disk space you can try debug it with a troubleshooting script for Compute Engine to identify issues with SSH login/accessibility of your Linux based instance that Google provides.
In addition, you can try to connect to your VM via Serial console by following this guide, but keep in mind that:
The interactive serial console does not support IP-based access
restrictions such as IP whitelists. If you enable the interactive
serial console on an instance, clients can attempt to connect to that
instance from any IP address.
more details you can find in the documentation.
Feel free to provide more details in your question and I'll update my answer.