In this sentence would it be better to use 'would' or 'could?' What's the difference?
I [would/could] go to the party, but I wasn't invited.
There are many different uses of would and could, and depending on the context, using could may or may not make sense here.
I think would here would take the sense of
would (willing) - used to talk about what someone was willing to do or what something was able to do
Thus, to say
I would go to the party, but I wasn't invited.
expresses that you would like to go to the party— but will not because you were not invited.
But you could use could here in the sense of
could (possibility) - used to express possibility, especially slight or uncertain possibility
Suppose, for example, I am weighing my options for what to do on the weekend.
We could go on a picnic, but it might rain. I could go hiking, but my knee might act up again. I could go to the party, but I wasn't invited.
You acknowledge the possibility of those activities, but you do not necessarily desire to do so, and think it unlikely you will, because you anticipate some problems.