In this passage John explains the confessions of a false teacher. We need to be aware as if the wrong people are telling us about our spiritual condition we may lose our assurance in Christ. John explains how we need to guard our hearts and praise God for our assurance.
16 Therefore let no one pass judgment on you in questions of food and drink, or with regard to a festival or a new moon or a Sabbath. 17 These are a shadow of the things to come, but the substance belongs to Christ. 18 Let no one disqualify you, insisting on asceticism and worship of angels, going on in detail about visions,[a]puffed up without reason by his sensuous mind, 19 and not holding fast to the Head, from whom the whole body, nourished and knit together through its joints and ligaments, grows with a growth that is from God.
20 If with Christ you died to the elemental spirits of the world, why, as if you were still alive in the world, do you submit to regulations— 21 “Do not handle, Do not taste, Do not touch” 22 (referring to things that all perish as they are used)—according to human precepts and teachings? 23 These have indeed an appearance of wisdom in promoting self-made religion and asceticism and severity to the body, but they are of no value in stopping the indulgence of the flesh.