Gibbs energy is defined as the energy 'available' to do work at constant temperature & pressure.The energy required to make the system from none under constant pressure is the enthalpy, that must be given to make the system. However, owing to the energy dispersal tendency to bring disorder to the system owing to its entropy is supplied by the environment. So, the energy given to form the system is $H - TS$ which is the Gibbs Energy.
This is the line noteworthy to be quoted from my book:
It is the energy available for doing work as the energy owing to the entropy cannot be used to do work.
So, can anyone tell me why the energy gained due to entropy can't be used to do work?