1.
If head is now null, set tail to null as well.
2.
Check whether head is null, and raise an underflow error if it is.
3.
Save the value stored in the head node in a local variable.
4.
Return the saved value to the caller.
5.
Move head to the head node's next reference.