Even if your OS XmacOS is dammageddamaged and the recovery partition is missing, by using the Cmd+R when you power on your Mac, if while it's connected to Internet (with Ethernet), itthe Mac will download the recovery partition by itself.
Apple support article on the topic. It should alsoalso be possible over wifi.