Diarrhoea with oral magnesium is a dose and salt issue, not a reason to jump to injections. Glycinate is usually the gentlest form, so try a lower dose split twice a day with food rather than one big dose. IM magnesium is reserved for documented significant deficiency or symptoms like cramps, arrhythmia, tetany, and it needs your actual serum magnesium value in hand. Also worth checking why you are losing magnesium at 25 - loose motions, PPI use, poor intake, alcohol.
Next Steps
Get serum magnesium,
calcium,
vitamin D and a basic CBC/electrolyte panel, then book a Practo consult with me and share the reports - I will decide oral vs injectable and give a proper prescription.