An iPad Pro can be used with a compatible Mac to extend the Mac display to the iPad using the Catalina/iPadOS Sidecar feature.
https://support.apple.com/en-gb/HT210380#systemrequirements
An alternative third-party product, Duet, can be used to extend a PC or Mac to an iPad:
https://www.duetdisplay.com/
Here is a third-party comparison of some of the options - including a detailed look at SideCar.
https://thesweetsetup.com/apps/best-app-for-using-an-ipad-as-an-external-display/
I hope this proves to helpful in guiding you to some of the available solutions.