1. Backup your home directory.
2. Using a live usb stick, repartition your hard drive to use a separate /home partition.
3. Restore your home directory backup into that /home partition
4. Now you can do a fresh install of the latest Debian (using the aforementioned live usb stick) while retaining your current desktop configuration. You will need to install packages again if they're not part of the standard installation.
Location of current Debian Stable with non-free firmware and closed-source packages (usually needed for laptops):
http://cdimage.debian.org/mirror/cdimag ... rent-live/and pick the iso of the desktop environment you would like to have.
If you want to retain the /home partition with your current desktop configuration, you will need to use the same desktop environment as before. Furthermore: during the install, select manual partitioning of the hard drive as you need to specify you want to use the separate /home partition and it must NOT be formatted.
If you don't care about retaining your current desktop configuration, then just download the iso, copy it to a usb stick and go to town.
With just 512 MB of RAM, you need to use a very compact desktop environment like LXDE of something like that. Gnome won't run well with so little RAM.