First- go get a stress test. They'll hook you up to an ECG (to watch electrical activity of your heart), put you on a treadmill (or sometimes a stationary bike), and have you work until you're close to your age-predicted max HR. They can look for arrhythmias and indications that you are currently having heart problems.

If everything checks out, then just practice, practice, practice. You'll get better as you figure out gearing, pedaling circles, learn how to pace yourself, learn when to sit/stand, etc...