Just for clarity, two links. Note that the USB-C adapters have either-or MagSafe end choice. Best to go for the older "sideways" end with Apple's MagSafe adapter for max flexibility. The USB-C link (2) below has explanatory pictures.
For those of you caught out by Apple’s discarding of the magnetic power adapter which has saved my MacBook on many occasion there is this useful device which inserts a magnetic break point in the mains lead