2007 Hyundai Sonata issue

I don’t think the car not cranking is related to the drivability problem, or is at most obliquely related. When a car refuses to crank, that is almost always an electrical problem in the high current circuitry, either with the battery, battery connections, ignition switch, safety switch, starter relay, starter selenoid, or starter motor.

I’d start by taking the car to a shop who can test the battery and charging system. This is simple to do and doesn’t take much time. Many major retail auto repair shops will do this for free.