When a person is declared to be liable to punishment for doing an act, that person shall only be liable to punishment after he or she is duly convicted.