I am reading a book and it states
If I were in a snarkier mood, I'd tell you to burn the book. I'm sure you can find other sources that can explain this more clearly.
A better (and simpler) definition in this context is that a protocol is a set of procedures and objects used for communicating between devices. You might think of it as a specialized language for communication. Each layer uses a specific protocol to talk to the corresponding layer on the other device. For example, IP is the protocol used by the network layer on one device to talk to the network layer on another device. Note that this layer to layer communication is logical.
I don't understand the concepts of these protocols in the OSI model.
Are they just code that gets invoked?
Forgetting for a moment that no one actually uses the OSI model, yes the protocols are implemented in code. They are a set of communications functions and data objects. This question and answer might help you better understand.
Is it put on every server machine that needs to conform to the
protocol when you are designing the network?
In the case of the TCP/IP model, every device that uses IP has the protocol stack. That includes PCs, servers, routers, etc.
Best Answer
There is much controversy about which protocols run at which layers in the models. Understand that the models, e.g. OSI Model, are just models, and the real world is often different.
There are people on both sides of ICMP layer placement. Remember that Wikipedia is maintained by everyone, including you. If you disagree with what is in an article, you are free to change it, or add something explaining why it should be a layer-4 protocol.
There are also other sources you should consult. In the end, you make up your own mind about where you think it belongs.