What is the best security $_POST method?

You have to sanitize or escape the data based on type and application of the data. Like below-

$title = sanitize_text_field( $_POST['title'] );
update_post_meta( $post->ID, 'title', $title );

It’s a quite huge topic. You better read this Validating Sanitizing and Escaping User Data.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)