A component can be flagged as favorite by simply clicking on a star icon available on the dashboard of any project, module or package:


or on any component on the Components page:


or at file level:

To display your favorites on a dashboard (on your home page for example), you can use a filter.