How to add a slack variable in a optimal problem?

You have been interacting with Johan Lofberg at the link you provided. Read his article https://yalmip.github.io/debugginginfeasible/, including section 6. “Solve a model with slacked constraints”

There are examples at Can someone please help me with my QP problem? and QP problem infeasible .