A few ways to do this. You will want to research how to create a GUI in Unity. You can use Unity’s built in GUI system (which is slow and painful): Unity - Manual: Immediate Mode GUI (IMGUI)
Or you can create a system using a secondary orthographic camera on a GUI layer and create physical geometry and edit the materials. This is the route I usually take. There are also various plugins in the asset store such as nGUI.
If you have a player with varying states that can die etc. its best to have a global script taking care of the hud. Tt could be attached to something permanent like the camera and get the variables like energy and lives form the player script.
You can find an examples in the 3d plaformer tutorial or in each of the game tutorials from the Walker Boys.