If you can still access iPhone, go to Settings>General>Reset>Reset All Data and Settings, enter iPhone screen password to confirm the change, but will lose all data on iPhone.
Or Connect iPhone to computer, if can be detected b iTunes or Finder, select Update from the pop window by updating iOS...