Compare the following snippets:
If you want to look like the top block, then you need to mark up the data on your page. This method of specifying data is called Structured Data.
Markup is a way to tell a search engine a specific set of variables. For example, to display a rich snippet for a movie page, you need to specify the following data: release date, country of production, list of main roles, etc. After analyzing the markup, the search engine will be able to display a beautiful snippet.
There are 3 markup formats: Microdata, RDF, and JSON-LD. Google recommends using JSON-LD.
A description of the various types of rich snippets you can find here https://developers.google.com/search/docs/data-types/article .
You can check the correctness of the markup and several additional checks related to it in our universal service https://site-alarm.com/tools/page-checker . Google also provides its own tool for checking markup https://search.google.com/structured-data/testing-tool .