For that first you have to know about template tags.
Template tags are used to fetch dynamic data, if you are using Wordpress then you can check the built-in tags are also available. If you want to check the example too then you can check
template tags.