How do I write and upload a LED blink program on a PIC (pic16f59)?
The error message you get indicates a communication failure between the PicKit and the chip.  It has nothing to do with the contents of your program.  It would help if you showed the schematic of exactly what is around the PIC and how the PicKit is connected.  Possible issues are:

Something is loading the PGC or PGD pin, which prevents the programmer from communicating.

Something is not allowing MCRL to be raised to the programming voltage.  I didn't look up the programming spec for this chip, but Vpp can be as high as 13 V for some PICs.

No bypass cap accross Vdd and Vss.

Not all power and ground pins hooked up if this chip has multiple.  Again, I didn't look up your specific PIC.

Too long a cable between the PicKit and the chip, which allows for crosstalk between PGC and PGD.



See my In-circuit Serial Programming paper for more detail and general demystification of the programming process.

On a separate topic, there are two flaws in your program.  First you need to set RB1 as output since it wakes up as input.  Second, you need to turn it off in the loop too if you want the LED to blink.  Right now your program sets RB1 high and leaves it that way.  If your chip has analog inputs, then you also have to make sure that RB1 is either not one of them or to explicitly switch it to a digital pin.