Namespaces divide one cluster into named areas. Teams and environments get their own, names only have to be unique inside one, and quotas and access rules apply per namespace. A few objects, such as nodes and namespaces themselves, belong to the whole cluster.
kubectl works in one namespace at a time. -n NAME points a single command elsewhere; kubectl config set-context --current --namespace=NAME changes the default for every command after it. A kubectl context joins a cluster, a user and that default namespace, and kubectl config get-contexts shows which one you are using.
Two habits prevent most namespace mistakes: create the namespace before you deploy into it, and pass -n on every delete when the same name exists in several places. Deleting a namespace deletes everything inside it, which makes it the cleanest way to remove a short-lived environment.
An environment from creation to cleanup.