If your external resource allows it, you could use the Http Client to send a HEAD request to check that the resource exists before trying to send the user to that URL, e.g.:
use Illuminate\Support\Facades\Http;
$response = Http::head($externalUrl);
if ($response->getStatusCode() === 200) {
return redirect()->away($externalUrl);
}
return response()->download('path/to/file');