How to properly credit other people when writing a text book?
Generally speaking, textbooks have the same responsibility to cite their sources as any other type of scholarly work. The one reasonable exception I can think of is a textbook about a very old and established subject like calculus, linear algebra etc. It is already sufficiently well-documented who deserves credit for these old ideas.

One slight difference in how the responsibility for citing sources is interpreted for textbooks as opposed to research publications is that the ideas in a textbook are not by default assumed to be the author’s. Thus, if an author fails to cite their sources, their readers will probably assume that this is due to sloppiness or laziness on the author’s part, may be annoyed by it or in an extreme case might even consider it a mildly unethical thing to do, but will likely not regard it as a form of plagiarism, unless the author phrased their words in an obviously misleading way to create the impression that the idea they are writing about is their own.

In other words, not giving detailed sources in a textbook is definitely bad practice, but may not get you into the same kind of trouble as it would in other contexts.

As for how to include the citations, it’s true that including them in the body of the text (especially if you also want to add a discussion with more details about the contributions of different authors) can be tedious. One common method, which I used in my book and I have seen used in many other places, is to add endnotes at the end of each chapter or at the end of the book.