I want to factory reset my computer. Can I do it with the command line or do I need to boot a pen drive with Ubuntu?

If I can do it with a bootable pen drive, what program can I use to create the bootable media on Ubuntu? I've tried Rufus, but it only works on Windows.

I am also thinking about switching to Kali Linux. Is it too heavy? Is it very different from Ubuntu?