At first, try to assess whether the link is likely to come back. This is a difficult one, since it depends very much on the context. I seem to remember a medium size open source project having all its pages replaced with the default Apache Httpd page ("It works!!!" or something like that) for a few weeks, because the server had somehow crashed, just at the time its main maintainer had gone on holidays. Don't necessarily start altering all the links to that site immediately after you notice it being down. (Sometimes, sites also move to different content management systems and links are at least temporarily invalid.)
Assuming the link can be considered as broken, put a comment asking the initial answerers to update it if they know (or do it yourself if you know where the content has now moved).
If nothing happens, remove the link. If the answer no longer makes sense at all, this probably was a link-only answer, flag it as such, it will probably be deleted.
There was some disagreement a few days ago on where to draw the lines with so-called "link-only" answers. In some cases, it can be useful to salvage the crucial piece of information from the link. For example, if the link is something like "[This library](https://github.com/someuser/SomeFantasticLibrary) addresses this very problem.
", even if that repository is deleted, rescuing the name of SomeFantasticLibrary
from deletion can make the answer still useful: someone finding that answer can still look for that project by themselves or look for a cloned copy. (Whether or not there's more text around this answer is another matter.) This is of course very dependent whether you can guess anything from the URL structure (URIs are meant to be opaque after all...).
When applicable, replacing the link with its Wayback Machine equivalent is a decent fallback solution.
Copying and pasting the content that you knew was there doesn't sound like a good idea. That content might not be yours to paste, and it might just be too long or completely disrupt the flow of the answer (link-only answers aside, there's often a reason why the reference was just a link in the first place).