So speaking about learning ...
This is definitely a dumb question but during battles and such where would generals be at? On a horse watching things or behind there armies or?
Like I keep hearing about (mostly confederate) generals getting sick and losing advantages because of it but wouldn’t they still have been capable of writing orders ?
so there was some physical aspect /risk right?
It depends on their level of command. Army and Corps commander usually (and should) stay mounted at the rear,
where they nail themselves to a good observation point, and send his aides with the orders. Remaining in the same area meant that the messages from other commanders reached him promptly and were responded to promptly as well.
Army and Corps commanders have historically been at the front and it usually does not end well.
As a sort of ultimate negative benchmark, take Bull Sumner from the Union side and A.S. Johnston from the Confederate. Sumner had three divisions at Antietam, and they were deployed in a rather staggered manner, mostly accidentally. French's division fell behind, got lost, and ended up heading for the Sunken Road, with Richardson's division following it later. Sumner was riding with his lead division, Sedgwick's, and had no idea this was happening. Sedgwickwas a competent, experienced regular army soldier; he didn't need Sumner to hold his hand. And to cap it all off, Sumner led the division into disaster in the West Woods. A.S. Johnston completely lost control of the Battle of Shiloh because he was riding to and fro on the front line playing brigade commander. When he needed reinforcements to break the Hornet's Nest, most of his troops were being funnelled to the other flank by Beauregard, who was distracted by Union counterattacks in that sector. Because Johnston was at the front, there was absolutely nothing he could do to stop this and maintain his desired attack plan. To cap it off, he got himself shot and killed.
Now, there's instances where a commander might really be needed on the front; the looming spectre of defeat at Cedar Creek probably necessitated Horatio Wright's presence on and near the front-lines to personally rally retreating troops and align defenses, for example.
Division commanders usually stay close to the front but not directly at the line of fire. They are typically mounted so as to be able to visit any sector of their division. If the situation called for it, division commanders could ride to the front to encourage the troops. Sherman, for example, rallied his division at Shiloh in the face of a determined Confederate attack. In fact, some commanders made a habit of fighting too close to the front. They weren't necessarily idiotic; Jesse Reno and Phil Kearny certainly weren't fools, and were actually fairly effective combat commanders. But they didn't adequately comprehend the responsibilities higher command conferred on them. Leading personal reconnaissances for instance, like Reno and Kearny died doing, or Ben McCulloch at Pea Ridge and Jackson at Chancellorsville, was not really the business of division or corps commanders.
Brigade and regiment commanders spend the war at the firing line. The attrition rate was fairly high but bravery and frontline leadership were expected from these officers.