You might start by reading one or more of these:
https://www.amazon.com/dp/0240516613
https://www.amazon.com/dp/0240820991/
https://www.amazon.com/dp/1932907319/