Build up strength
The heart is a muscle not unlike the muscle in the legs.
If it is injured it needs to have a gradual return to normal function. Similar to when you pull a leg muscle, an injured heart muscle must be slowly return to peak functioning. If you try to push too hard physically after a heart attack
you might further injure the fragile tissues. Cardiac rehab is a controlled environment to safely ramp up.