i am create wordpress plugin that show error?

If you want to add headers this can only be done before you are returning data. Headers are send at the start of a response from the browser.

What probably goes wrong is that you have an empty line on the top of your file. Or you do somewhere an echo (or something a like). Then PHP starts outputting data (thus returning stuff to the browser). Then you’ve missed your change of adding headers.

Please check if you don’t have an empty line in your file like this:

.empty first line or any char here.
<?php
   echo 'hi'; // Echo here BEFORE your setting any headers
?>
.or an empty line/char here?

tech