The first thing I'd do in such cases is check the revision history of the question. Sometimes the OP will substantially edit their question to radically change what they're asking. If the answer once answered the question but the question was changed, then the edit to the question should be reverted and a comment left for the OP to post a new question rather than editing an existing one.
If the answer doesn't, and never did, have anything to do with the question and is clearly answering something entirely different than what the OP is asking for, then it's "not an answer". I'd suggest flagging it as NAN, but past experience has told me that when the answer, by itself, looks fine, and only is wrong in the context of the question, those flags will be declined since the flag queue only shows the post, not the related question. Instead flag the question using the "other" flag and state that the post is "not an answer" because the question is asking something entirely different than what is being answered; this will prompt the mod reviewing the flag to go to the question itself and judge if the answer actually attempts to answer the question. They will delete it if it doesn't.
If you have 20k reputation you could also just vote to delete it.