How to add a panel/box/widget/are/screen to the right side of edit post/page confusion

If you’re using classic editor, then add_meta_box() will do the trick. Just make sure you set the context as “side”.

With Gutenberg I think you’ll need a Panel component. I’m not too familiar with Gutenberg so I can’t comment more on this.