Complex sentence: After the Civil War ended in May 1865 in Union victory, the defeated former Confederacy was ruined having been devastated economically, politically, and much of its infrastructure had been destroyed by the war.
Split into simpler sentences: After the Civil War ended with a Union Victory in May 1865, the defeated former Confederacy was ruined. It had been devastated economically, politically, and much of its infrastructure had been destroyed during the war.