What's not working? Are you able to access recovery and the factory reset option didn't work or did you not get there at all?
Does the phone still boot normally? If so, there should be an option in the phones settings to factory reset.
If all else fails and you don't have boot, you can think about flashing the stock firmware if its publicly available. That's the most invasive option so let's see what responses you have to the above questions before going down that road.