So, the most absolutely simplest way to do this that I can think of is this (and simple in the sense that it is hard for even a newbie to get wrong):
1) Normally install Raspbian on a new SD-card
2) Using a Linux computer with Gparted (even a raspberry) (or a windows computer that you temporarily boot into a Gparted live CD), open the bad card and carefully select the bad Raspbian partitions (the boot and the root). Be careful to not select the wrong partitions, for example from other operating systems.
3) Delete these partitions.
4). insert the new Raspbian card, and copy paste the partitions from there on to the locations where the old ones were. They should fit the emmpty spaces if you have not expanded the new Raspbian partitions after install (they will be really small)
5) Now you need to adjust the files that point to these partitions during boot, because the new partitions have new ID numbers. If you only update the root partition, then all you need to do is "sudo blkid" and get the ID number, and edit that into cmdline.txt. You point to the root (from cmdline.txt) with "root=". AFAIK this can accept either a UUID, a label or a block device address like /dev/mmcblk0p2. If you need to replace the boot partition, then I think there was some place in NOOBS where this is pointed to. I cannot remember anymore. (try
https://github.com/raspberrypi/noobs) Or, since the boot partition is a small simple FAT32 partition, you could just copy the files from the working Raspbian /boot to there. (unlike copy pasting a partition in gparted, which uses dd, using cp in linux will not create a new partition and new name/id for it. cp will also not retain file attributes, which is ok as FAT32 is not a linux file system and will not use linux file permissions/ownerships etc. This same thing will not work with root partition as it is ext4, although you can use cp or rsync with flags that would also keep the attributes). Before you also needed to update /etc/fstab, if you wanted to have the partition mounted correctly after boot, but I think that systemd nowadays knows how to mount the partitions even if you uninstall fstab entirely, so I don't know if you need to do anything there
You can also do this with other tools like dd/rsync if you know how to preserve file attributes, but it is quite simple to use the gparted graphical interface to just mouse these partitions around. One benefit of copying files instead of moving partitions is that the partition names and identifiers remain the same...