The forecast object is a list. You probably want the point forecast (the mean of the forecast distribution) to use as a covariate, which is stored as mean in the forecast object. So here is some code that forecasts mdeaths as a function of fdeaths.
library(forecast)
fitm <- auto.arima(mdeaths, xreg=fdeaths)
fitf <- auto.arima(fdeaths)
fcf <- forecast(fitf, h=10)
fcm <- forecast(fitm, xreg=fcf$mean)
autoplot(fcm)

Created on 2021-11-24 by the reprex package (v2.0.1)
While that works, it ignores the uncertainty in the forecasts of the covariates. A better approach would take that uncertainty into account by simulating future sample paths of the covariates and using those to simulate future sample paths of the main variable.