PureCode Software interview question

How do you ensure security in a MERN stack application, especially when dealing with user input?