Compare مَعِضَ (maʕiḍa, “to resent”), مَضَغَ (maḍaḡa, “to chew”), مَضَّ (maḍḍa, “to hurt, to pain”).
Practice speaking and memorizing "مغص" and many other words and sentences in Arabic.