With Apple's Sidecar feature, you can use your iPad as a display that extends or mirrors your Mac desktop.
Before you get started, make sure that you have macOS Catalina installed on your Mac and the latest iPadOS installed on your iPad. You'll need to sign in to iCloud on both devices using the same Apple ID. You'll also need to make sure that you’ve got both Bluetooth and WiFi turned on.
To use the Sidecar feature, follow these steps: First, click the Airplay icon in the menu bar on your computer then select the iPad you’d like to use. This lets you connect the two devices wirelessly. To use a wired connection, connect the two with a compatible cable.
Once the two are connected, either wirelessly or by cable, the Sidecar icon will replace the Airplay icon on the menu bar. Click the Sidecar icon, and select Use As Separate Display if you want to utilize it as an extended display or Mirror Built-in Retina Display to use it as a mirrored display.
For additional information, see: Use your iPad as a second display for your Mac with Sidecar from Apple.