For the average power, you need to compute the power consumed when active and multiply that by the percentage of the time that the component is active.

For example, the dissipation in the switching transistor withing the IC. The voltage dropped is given in the spec table:

Multiply that by the average current through it to get the power. The average current when active can be assumed equal to the average input current. You can calculate that from generic buck regulator equations with an estimated efficiency. With that, you have the average power in the transistor when active. However, it is only active for a portion of the time.

The next step is to calculate your duty cycle based on your input/output voltage - this will tell you what percentage of the time the transistor is conducting. Say the FET is on 60% of the time. Multiply your "average power when active" value by 0.6 and you will have the total average power dissipated by the transistor.

There are other losses (switching losses) that are harder to calculate and easier to just obtain through a real measurement.

Same idea for the diode (assuming you are referring to the switching diode). Forward voltage times average current.