One option is to read our book very thoroughly, build each chapter using the
online code and understand all the concepts in detail, before you move on to the next chapter.
Or, if you already feel confident with several aspects of game development, you can focus mainly on the parts that are new to you, and look up the code for them. You don't necessarily need to
write code yourself (or re-produce the book's code), often you can gain a lot of insights by playing around with the code provided to you, whhile changing it according to your imaginations.
Third, if you think that certain parts of the book are not relevant for your future projects, you can skip them and come back only if you need them. I would not recommend this for the basic chapters though -- game loop, input and state handling as well as basic graphics are so universal that you can't make a game without them. But topics like shaders, audio or network programming are usually not the first thing you do when you develop a game, so you might return any time you see fit.
TLDR: It depends what you want to learn, and how you learn most efficiently. Choose a way where you can keep up your motivation, and advance small steps at a time.