Hi, I had the same problem with my Cmax before, the problem was that my car had a dirty throttle body and a very dirty air filter. Open the bonnet and see the throttle body and air filter they are easy to clean specially for the Cmax without the need to see the mechanic. Here is a link for the throttle body just copy and paste the link :
This is a link for the air filter.
after cleaning those my car was fine. After cleaning those see if it fixes it. if it does not and the problem is still there you may as well go to the mechanic because sometimes other parts of the engine needs replacing or cleaning.