Upon startup, press [command]+[option]+[R], this will allow you to install the latest "available+compatible" version of MacOS for your laptop. For example, on a Macbook 2012, the factory OS shipped with the Macbook is MacOS Lion version, if you press [command]+[R], it will attempt to re-download the "Lion" version, which is not available and it will fail to download. In stead, with [command]+[option]+[R], it will download macOS High Sierra.