Hello reda166,
Thanks for asking the Apple Support Communities for help with using an iPad as a display with your Mac.
It sounds like you are trying to enable Sidecar. As per the help article here: Use your iPad as a second display for your Mac with Sidecar - Apple Support
You would need to log in to the computer to enable these settings. If you connected your computer to an external monitor or TV before, you might be able connect to that again as you may have already enabled these settings, then you can enable your iPad: Use external monitors with your Mac - Apple Support
Otherwise, you can look at this repair link: Mac Service and Repair - Apple
Thanks and have a wonderful day.