Take a look at the game state pattern.
The basic idea is that you have a class for every state. All classes inherit a interface that ensures basic functionality like entering the state, leaving the state, updating and rendering. Each specific state implementation holds (or has references to) all necessary resources and performs what you want to do. At some point in your program you keep the current state and provide methods for changing it, which are accessible by all states. Depending on your use-case you might want to have multiple states active, but for starters a single one is usually sufficient.
You can find a good in-depth explanation on this blog entry, but searches for "game state" will bring up many good results.