How to display content based on conditional statement?

Hello,

I was wondering what the way is to conditionally show and hide based on routing (e.g- some part of the component needed in home but not needed in details page). how can I conditionally check that?

Thanks!