If you want to use Sidecar (native wireless connection) then you need the same Apple account (note Apple ID is now renamed). If you’re ok with using a wire I also have used Duet, as alexc recommended, and which doesn’t require the same Apple account. I have found it a bit flaky but usually ok.
You might also consider a small portable usb monitor instead of an iPad.
to be honest I haven’t used Duet in a few years, but I recall that it’s one of those apps which either just magically works or it doesn’t and there’s not much you can do to debug. So sometimes I’d connect the wire and it just wouldn’t show up as a display, and the iPad app didn’t report any connected device, and there’s not much you can do to try to figure it out. So I unplug and replug a few times, try different wires, different usb ports etc.
But when it does work it was great - very little latency, good quality etc.
I’ve been meaning to order a portable usb monitor for a while so I used the opportunity to order one today. I got the LG +view.