Can't install XCode

This is frustrating. I’m trying to download XCode from App Store but the app can’t be installed because macOS version 10.15.2 or later is required.

I’m using IMac (21.5-inch, Mid 2010) running on MacOS High Sierra 10.13.6.

What should I do?

Welcome to the community!

You can install older versions of Xcode. You’d have to google from where exactly.
Just lookup “install older versions Xcode”