A safe order of work
Always allow established connections and your SSH port before setting the default policy to drop, or you will lock yourself out. The generated rules do that in the right order. On a remote server, run them inside a screen or tmux session, or schedule a rollback (for example: at now + 5 minutes <<< 'nft flush ruleset') and cancel it once you have checked you can still connect.