The FlashForge 5M Pro has automatic calibration. Follow these steps:
1. Select the "Settings Cog":
2. Select the 4th tab along and check the "PID calibrate" checkbox
3. Hit the "Start" button:
If prints are still not adhering to the bed, try using the included gluestick on the build plate and/or print using a raft (this is a setting in FlashPrint -> 'Advanced').