How do stars produce energy if fusion reactions are not viable for us? From what I've learned, fusion reactions are not currently economically viable as of right now because the energy required to start the reaction is more than the energy actually released. However, in stars they have immense pressures and temperatures which are able to allow these reactions to take place. However, if these reactions are considered endothermic for us, how are they exothermic in stars? i.e. how are stars able to release energy?
Moreover, why are such fusion reactions for us endothermic in the first place? Given we are fusing elements smaller than iron, wouldn't the binding energy per nucleons products be higher and hence shouldn't energy be released?
 A: The Sun is fabulously inefficient as a fusor: in a given year it consumes only about $10^{-10}$ of its fuel.  For the Sun that’s actually a good thing, because it took us five billion years to notice.  But an Earthside reactor where you have to confine and control a billion times more fuel than you actually use is quite different from the approach we’ve taken through history.
The Sun also operates at very low power density: in the hottest part of the core, about a hundred watts per cubic meter.  You can imagine reproducing this power density by filling the inside of your house with scaffolding and operating one light bulb every cubic meter. It’d be warm, for sure, but not solar-warm; you might not even need to re-wire your house.  You could get higher power density than the core of the Sun just by setting your house on fire.
The reason the Sun is still useful as a power source, despite its fabulous inefficiency, its low power density, and its astronomical distance, is that the Sun’s power-generating core is mind-bogglingly large.
At constant power density, the amount of effort it takes to confine a hot plasma goes roughly like its surface area (because you only have to push on the outside surface).
Suppose I have a tokamak which produces a certain amount of fusion power and has a certain cost to keep the plasma contained.  If I build the same design but three times bigger across, I expect the cost of confining the plasma to increase by a factor $3^2 = 9$.  But if I keep the energy density the same, the energy output should go up like the volume, by a factor of $3^3 = 27$.  The engineering question then becomes whether I can make the tokamak large enough that the power produced outstrips the containment cost, while still having it fit on Earth, in a building. (A big building would be okay.)
A: Whether a fusion reaction is exothermic or endothermic depends on the binding energy of products relative to reactants as you suggest. It does not depend on the environment. However, the rate at which the reaction occurs does depend on density and temperature. These determine how often nuclei collide and what proportion of collisions result in fusion (overcoming electrostatic). Even for the easiest fusion reactions (e.g., the D+T reaction) temperatures of millions of degrees are required for a non-negligible reaction to occur.
The reason current fusion reactors consume more energy than they release is due to the energy required to heat and contain the hot plasma. The plasma in current reactors loses energy more quickly than fusion reactions release it.
A: None of the other answers (so far) mentions gravity. At least one of them mentions confinement though. It talks about the cost of confinement and, about the consequences of not confining a reaction well enough or long enough to extract any benefit from it.
Stars, on the other hand, get confinement "for free" by virtue of the gravitational binding of their enormous mass.
A: For the second part of your question, you have noted that all the lighter elements have binding energy less than iron. Binding energy is the energy that needs to be supplied to unbind something, so the binding energy of an iron nucleus is the energy you would need to supply to split that nucleus into protons and electrons (recalling that a neutron will break down to a proton and an electron). Fusion releases that energy when the hydrogen in a star is converted to other elements including iron.
A: The reactions are exothermic. But in a volume the size of the sun, the fusion reactions are so deep within the star (within its core), and in such dense material (the core), that they cant easily lose all their energy to the outside.

*

*Photons can take thousands if not millions of years to exit the core.

*Heat is retained because it's produced based on VOLUME, but lost via SURFACE AREA - a larger sphere has much less surface area per unit volume to lose/disperse energy,and the sun is vast by human standards.

*Confinement is due to sheer mass, gravity is effective at this.

*Gravity not only confines, it also maintains immense pressure.

So the sun itself, even though it's not very efficient a heat engine, produces enormous heat, just because of its sheer vast size negating all these issues. The core cant easily lose heat, or reduce pressure. Even a relatively slow heat buildup keeps accumulating, because the heat cant be lost easily, and also there is immense pressure, all throughout the immense volume of the core.  Any loss of pressure or temperature within the core, or reduction in fusion equilibrium, results in the core shrinking which increases pressure and temperature, so it's largely a stable situation while fuel exists.
So fusion is easy, and sustains itself, with very high TOTAL energy output, even though the heat production is technically quite low per unit volume and pretty inefficient.
What we are trying to do on earth, is find a way to confine the heat and fusing particles, without any of these advantages of immense size or gravity. It's very easy to lose energy, on the scale of any plausible human-built fusion reactor. It's very hard to confine properly.
This is what the challenge is about.
A: It is the fact that fusion reactions are very exothermic that makes them so hard to control.
Coal releases its chemical energy so slowly that a coal fire does not need any confinement - it does not blow itself apart. Refined hydrocarbons, such as petrol, release energy more violently, but the walls of a metal cylinder are strong enough to contain the explosion (e.g. in an internal combustion engine) or at least direct the explosion products in a useful direction (jet engines, rocket engines).
We have various ways of achieving nuclear fusion (see this Wikipedia article for an overview) but they all either blow themselves up (thermonuclear devices), require too much power to achieve confinement (magnetic and inertial confinement devices) or produce a low density of reactions (colliding beam devices).
A: 
However, if these reactions are considered endothermic for us, how are they exothermic in stars?

The reactions are still exothermic for us. In fact, they are very exothermic. The fact that they are not net energy producers is due to inefficiencies in our existing technologies for producing these reactions, not because the reactions themselves are endothermic. In other words, our fusion devices waste a lot of energy, heat that leaks out to the environment and so forth. So even a highly exothermic reaction does not compensate for all of the waste and inefficiencies.
A: As I see the core of your question is based on the “exothermic/endothermic” problem.
Fusion reaction is exothermic both on earth and on stars. When one binds two light elements, one ends up releasing energy always. The negative energy balance of fusion apparatus on earth is not due to the fusion reaction mechanism itself. It comes from the enormous energy necessary to keep atoms close enough to allow the fusion reaction to be sustained after initiated. As you noticed, in stars, this containing energy comes for free from the huge gravitational push that stars have. On earth, the containing energy is usually taken from incredibly high strength magnetic fields, which need an equivalent high consumption of electricity.
Because of this high energy consumption to keep the plasma contained, we cannot sustain the fusion reaction long enough to get back the energy spent to start the reaction plus the energy needed to keep it running on a reasonably amount of time.
An interesting fact is that the ratio of the energy consumed to contain the plasma by the energy gained from the reaction reduces inversely with the size of the reactor. The problem is that we still need incredibly big installations to make it cost effective using current technology.
A: As others have pointed out, the fusion reactions inside the sun and man-made on Earth are exothermic. Per mass of reactant, they release far more energy than any chemical reaction, and even more energy than fission.
Even the experimental reactors technically produce energy. If you take the Q=0.67 result from JET, then 24MW went in, 16MW was generated, and 40MW came out. For ITER, the projection is 50MW in, 500MW out.
But both of these are a long way from being economical. ITER is not even designed to generate electricity, but if it was, it would struggle to generate more than it consumes. That 50MW to heat the plasma comes from complex machines (fancy microwaves and particle beams) that run on electricity, with about 50% efficiency. So the input in terms of electricity is 100MW. On the output side, you have to deal with the Carnot efficiency, so that 500MW of heat will only generate about 200MW of electricity (40% efficiency). By the time you run pumps for the reactants, exhaust, coolant for the superconducting coils, a whole bunch of measurements... there's not a lot left over.
So a fusion reactor based on the ITER design that produces electricity has to be much larger. Designs at the moment aim for about 3000MW of energy for an output of 1000MW net electricity. Based on those designs you can start talking economics, but it's complicated. That reactor has cheap fuel, but expensive components. Superconducting coils, microwaves, radiation protection... it's hard to predict what the end cost of electricity would be based on these costs if we're still figuring out how to build the reactor.
As others have pointed out, the sun doesn't care about economics. Hasn't turned a profit in millennia. And by human standards of power density it is actually fantastically inefficient. But that's fine by me. It's about the right amount of power to keep Earth in a stable life-supporting temperature range.
A: The problem is not with “creating” fusion: we have H-bombs that will do this.  The technical difficulty is with controlling the very exothermic fusion process, so the whole thing doesn’t blow up violently.
