If I flash my phone; will I lose all the data on the phone?

Can't it be fixed by updating or upgrading the firmware?