The literature and documentation in operations research optimization is enormous, going back to the 1950s. The best of that literature is quite well written.
For combinatorial optimization, there is
George L. Nemhauser and Laurence A. Wolsey, 'Integer and Combinatorial Optimization', ISBN 0-471-35943-2, John Wiley & Sons, Inc., New York, 1999.
The details of optimization are not always trivial, and several fairly challenging graduate applied math courses, complete with non-trivial theorems and proofs, can be needed for much depth in the subject.
I've had four such courses and taught one.
> I guess it's extremely difficult to implement generic optimization solver,
A "solver"? Would be nice to have a "solver". Lots of people talk about giving a problem to a "solver". For linear programming, maybe usually can do that.
Otherwise my experience is that asking for a general purpose solver is, for now, hopeless.
Instead, for the real problems I've had success with, have to look carefully at the problem and exploit special structure particular to that problem.
Typically part of the work involves doing some derivations using the math of optimization.