It felt like the entire car was shaking

When I got in my Mazda 626 today at the local grocer I depressed the brake pedal as always and turned the key only to have my entire car feel like it was shaking this had happened before and teh mechanic said it was just because my battery had died and had to be replaced and the car’s brain hadn’t had time to reset itself that was over 3 months ago a neighbor suggestedmaybe the brake cylinder? When I asked brake booster he said no master cylinder…My mechanic is on vacation for a week and he knows the history of the car and I try not to have too many people doing too many diffeent things to it HELP

I don’t think anyone will be able to tell exactly what you are saying.

The car started and sat shaking? Was the check engine light blinking at you? Is the check engine light on now? What happened when you took your foot off of the brake? What if you start the car without having the brake applied? (And if the brake was related it would be the brake booster, not the master cylinder).

What year is the car? How many miles? Provide some information on the state of basic maintenance items such as spark plugs, filters, etc.

Is the car driveable?
You did not tell us if this symptom somehow went away, or if it persists.
That detail is VERY important.

What model year is the car?
How many miles are on the odometer?
What is the maintenance history of the car?

Is/was the Check Engine Light illuminated?
If the answer is “yes”, then you need to find out what trouble codes were stored by the OBD system of this Mazda of unknown vintage and unknown odometer mileage.

Right now, you have provided so little detail that I can only recommend two courses of action:

If the car is driveable, go to Auto Zone, Advance Auto, O’Reilly, Napa, or another parts retailer for a free scan of the car’s OBD system. If the CEL is/was illuminated, they should be able to obtain a code or three.

If the car is not driveable, you need to have it towed to a competent mechanic for evaluation. Please give the mechanic much more information than you provided to us.