Ride your bike lots
Get an understanding of your fuelling requirements.
Set a pace that is sustainable.
Build gradually until you know what is involved.
Time in the saddle is the only way.
Depends upon what point you are starting from - you say beginner - can you ride a bike, if yes then what's current mileage etc.