For the former, I solved it by making something kinda like what I was assigned to make, just to get something in the text editor, then change that to the needed product. For the latter, building confidence with other activities like piano or lifting weights helped a bunch.
Maybe a good vacation is in order either way?
Here's hoping whatever's blocking you clears up.