Before proceeding, ensure you are actually on 10.13.6.
Fix: This often happens if you downloaded using Chrome. Use Safari instead. Also, ensure you have 20 GB of free disk space (Xcode extracts to ~8 GB, plus temporary space). download xcode for mac os high sierra 10136 work
Go to: https://developer.apple.com/download/all/ Before proceeding, ensure you are actually on 10
Sign in with your Apple ID (free account works). Fix: This often happens if you downloaded using Chrome