Which phone?
Which version of android?
Which carrier?
Which camera app?
Most apps will require you to manually change the mode using multiple button taps, so doing it by mistake seems unlikely.
If you mean that the camera app does not remember the last mode used when it starts, for example always starting in "auto" mode, then this is probably not something you can change.