How to use longtext input securely?


I am developing a plugin. I need to put a longtext input in my plugin. But I worry about it, because a longtext input is a good place for XSS attack.

How can I use it securely ? If I use sanitise_string(get_input(inputname)) it will have problem with good html tags.

What you do in this situations?