Your heart is a muscle. It needs physical activity so it can pump blood and oxygen throughout your body. The phrase "use it or lose it" is never truer - if you don't get exercise, you will further weaken your heart muscle. (Check with your doctor about when you can start walking again after your heart attack and for how long. Also, ask if you need to take any precautions when you exercise).
When you are well enough to begin a regular physical activity program, start small with a five-minute daily walk. Then increase to a 10-minute daily walk the following week. You can also go swimming, or sign up for water aerobics or low-impact aerobics classes at your local YMCA or fitness center. The important thing is to find some form of physical activity that you enjoy; otherwise you won't stick with it. Find a friend to exercise with - you'll keep each other motivated. A cardiac rehab program will also help you to develop a new excercise regime.
Your ultimate goal is to get 30 minutes or more of physical activity most every day. And you don't need to do intense aerobic workouts. Moderate physical exercise, such as brisk walking, dancing, gardening, and house cleaning, will do.