Cant stop code from being run after reset

How can i implement a latch?