Shane has an excellent post below (from 2012) on legalism (what it is, what it is not, and how to avoid it).
I must not make up rules that I think would please God, nor can you force me to please God by your rules. Holiness is defined by God in his word, not by our likes, dislikes, or traditions. You and I don’t define devotion, God does. We’ve got to be careful not to add to God’s law; sadly, when we do so, even though we may think we’re pleasing God, we’re really not!
Andy Naselli recently had a similar helpful post on the same topic:
Andy quotes Phil Johnson’s book “Real Love and Real Liberty,” which I quote in part, below. Andy also quotes and links to several other useful works so check it out.
[A]nother kind of legalism is the legalism of the Pharisees. It’s the tendency to measure spirituality by a list of manmade rules. This kind of legalism is a common pitfall even within the household of faith. At the root of Pharisaical legalism is a belief that holiness is achieved by legal means—living one’s life by rigorous rules and restrictions: “Do not handle, Do not taste, Do not touch” (Colossians 2:20–22). This type of legalism doesn’t necessarily destroy the doctrine of justification like the legalism of the Judaizers. But it does significant damage to the doctrine of sanctification, and it is certainly appropriate to call it what is it: legalism. It is a sinful misapplication of law, an attempt to make law do work that only grace can do. Like the Judaizer’s brand of legalism, it brings people under a yoke of bondage Scripture has not placed on them.