How to prevent XSS attack - cakephp 4

Dear @raul338

Thank you so much

Normally attack comes in input field like below;

<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">

So how to stop hacker to stop writing a code in the input field and database details?

if you can explain regard to input field much appreciated.

thank you

Jeewaka