Forgotten your passcode? How to restore a locked iPhone or iPad

Forgotten your iPhone or iPad passcode? Or maybe a relative can’t get into their device and has asked you to help?