Gimp 2.10 - how to deactivate last layer

If the outline is moving, then you likely have an active selection. If you are sure that you do not need this selection anymore, you can use Select > None (or its default shortcut key, Ctrl+Shift+A) to get rid of it.

It could also be the outline of something you pasted, which shows up as an item labeled Floating Selection in the Layers dialog. Depending on whether you want to keep or discard this, you can turn it into a new layer or delete it from there.