These end in -ment too, but they are feminine.
Prenez ce médicament. Vous vous sentirez rapidement mieux.
Take this medicine. You will feel better soon.
Est-ce que ces médicaments agissent sur l'estomac ?
Does the medicine act on the stomach?
Gardez le médicament hors de portée des enfants.
Keep the medicine away from children.
FrenchTextbook teaches rules like this, in a full beginner course.
162 lessons, 4,000+ exercises, and 6+ hours of audio.