My wife's old focus did that. It also got to be hard start. Turned out it was her fuel pump going bad.
If the engine code is for a bad o2 sensor the. It could be sending the wrong info to the ECU and the ECU not making the correct adjustments to the fuel trims for the motor. I would replace the o2 sensor and see if that fixes your problem.
I won't say for sure but it was with my wife's car. Hard to start and then a bunch of white smoke followed by a constant slower stream of white smoke. The o2 sensor is easy to change and not terribly expensive. Replace that and get back to us.