How to handle escape echo problem

I am developing a theme and having these 4 warning. Even I think all warnings are same type. How to avoid this. Please help.

  • WARNING: Found echo $ in the file template/home/anilaHome-3-content-video.php . Possible data validation issues found. All dynamic data must be correctly escaped for the context where it is rendered.

Line 22: <?php echo $videos[0]; ?>

  • WARNING: Found echo $ in the file lib/anila-customExcerpt.php . Possible data validation issues found. All dynamic data must be correctly escaped for the context where it is rendered.

Line 17: echo $output;

  • WARNING: Found echo $ in the file footer.php . Possible data validation issues found. All dynamic data must be correctly escaped for the context where it is rendered.

Line 24:

Line 32:

Line 40:

Whenever you’re rendering data make sure to properly escape it.
Escaping helps secure your data prior to rendering it for the end user and prevents XSS attacks. you will get more help on google search (especially look on developer.wordpress.org).