John uses here the common word for to witness
and so conveys the sense of the speaker sharing something from his own experience (in Scripture typically what he has seen or heard from Jesus Christ). In the present case, the speaker is telling his hearers that he knows from personal experience which consequences invariably follow when one adds to or subtracts from God’s Word. The term’s use in the present context puts the content of the words spoken (related in Revelation 22:18–19) into the category of an oath which one ignores at one’s own peril. Hence the ESV's warn.
18 I warn everyone who hears the words of the prophecy of this book: if anyone adds to them, God will add to him the plagues described in this book,