Is milk of magnesia safe?

I’ve take it twice in the last 2 weeks when I’ve been seriously constipated.. is it safe to use as my go to laxative since it works? Or should I be taking something else?