Here is a nice, succinct,and easy to understand reference for how to do all this and more. Answers to many future questions can be handled by referencing the appropriate section number in this document and then addressing any particular difficulties or concerns the questioner may have.
FICO MIP formulations and linearizations Quick reference at https://www.fico.com/en/resource-download-file/3217
Introductory references which are more tutorial but less comprehensive, which may help people better understand the previously listed reference.
https://yalmip.github.io/tutorial/logicprogramming/. YALMIP background on how common mixed-integer representable functions and logic can be modelled, which is helpful even if YALMIP is not used.
Many of these formulations can be handled under the hood by modern optimization modeling systems.
For instance, indicator constraints in CPLEX.
Note that per https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/discr_optim/indicator_constr/06_restrictions.html in CPLEX, "The constraint must be linear; a quadratic constraint is not allowed to have an indicator constraint."
Note that per my updated answer at When to use indicator constraints versus big-M approaches in solving (mixed-)integer programs, Indicator Constraints in CPLEX are immune from the big M trickle flow issue mentioned later in this answer under "Be careful with choice of Big M, and its relation to solver integrality tolerance"
Gurobi General Constraints: https://www.gurobi.com/documentation/8.1/refman/constraints.htmlstrong text
YALMIP "implies" automates modeling of some logical constraints https://yalmip.github.io/command/implies/ . Explicit finite lower and upper bounds on all involved variables are required so that a Big M formulation can be derived under the hood by YALMIP to handle the implies.
Be careful with choice of Big M, and its relation to solver integrality tolerance
Keep in mind, as the YALMIP developer Johan Lofberg has stated, that Big M is misnamed. It should be called just big enough M. Excessively large M can result in weak formulations which degrade (slow down) the solution process. In extreme cases (but not uncommon for "amateurs), as a result of solver constraint satisfaction tolerance, an excessively large value of M can cause the solver to produce a solution which violates the logic constraint as intended. That is because integer (including binary) constraints are only satisfied to within an integrality tolerance, which typically is 1e-5 or 1e-6. Further details are provided by @prubin at https://orinanobworld.blogspot.com/2018/04/big-m-and-integrality-tolerance.html . IBM CPLEX documentation refers to this as "trickle flow" https://www-01.ibm.com/support/docview.wss?uid=swg21399984
If M needs to be so big that it would cause the logic constraint to not be satisfied as intended, the integrality tolerance should be made smaller, and verified to be small enough. Proper scaling of the problem can in many cases ameliorate such difficulties and allow for a not very large M.