How to force a factory reset or hard reset on Hero devices

Hero 9300 Hero 9300
Hero 5S Hero 5S