I have well over 100,000 miles' riding experience (and it would be perhaps close to 200,000 if I hadn't quit riding for 13 years), and still, part of getting back in shape every spring, after the cold, short, wet winter days put a lid on my riding for a few months, is reconditioning my rear to painlessly handle being on the saddle for hours, and getting my neck, shoulders, feet, etc. back in shape. It's not only about getting my strength and endurance back. When people complain about the saddle, or ask for saddle recommendations, I tell them that until you get your "undercarriage" in shape, there probably won't be any comfortable saddle (and also, what works well for one person may never work for another).
Fit is not a simple thing though, even though FitKit and possibly others have tried to make up a system where the fitter just takes the rider's measurements and adjusts the bike for those, without regard to past injuries, age, experience, inherited musculoskeletal traits, etc.. Do note that the ideal fit will indeed change as you gain experience, such that what felt best one year may not be ideal a year or two later. It's good to listen to others' experience and advice, but know that some of that free advice will be worth exactly what you paid for it, while other advice will definitely be worth serious consideration, as you experiment and get to know your own body, bike, and what constitutes a good fit.
I will add a comment here that "geometry" is not just about the position of the rider. Two different bikes could put the rider in exactly the same position, yet one handles great and the other handles terribly, because of head-tube angle, fork rake, stem length, and more. Small people are often put on 700c wheels (I can only speak for road bikes, not MTB) just for more tire choices and availability; but they cannot get good handling on 700c. When our son was racing in Juniors, we saw so many kids put on 700c's, and it was like they were sitting down between the wheels instead of over the bike, and they'd weave and they obviously didn't have good command of the bike. A friend, a very small woman, was riding a tiny carbon-fiber Calfee with 650c wheels, and needed a new rear wheel, and couldn't find any, so she thought she had to have a custom frame builder make her a frame with 700c's. She traveled hundreds of miles for this, got measured, and got a frame made. Her position on it is good and comfortable, but she says the handling is terrible. Use 650c for short people, even 24" for kids. Again, this is for road bikes. I am not knowledgeable in MTBs.
As mentioned by others, cramping can be from simply not being in shape yet, or from dehydration, or from failing to replace the electrolytes you lose in your sweat. I came across a web page years ago telling how much of various things we lose in each liter of sweat. The list was long; but the major things were sodium and potassium. I calculated from that that I should put at least half a teaspoon of sea salt in each quart of water, and at least an eighth of a teaspoon of Morton's Lite salt, which is half potassium chloride, in each quart of water. I've been putting 50% more than that in, and when I started that, it spelled the end of the cramps, except one time I got way behind on my drinking. You can weigh yourself before and after a ride to see if you've been drinking enough. If you never peed during the ride, each two pounds lost means you should have drunk another quart, 32 ounces. Don't be afraid of the weight of all the water you need to carry slowing you down. Dehydration will slow you down more than the weight of the water does.