der Ban
ban
A block or exclusion of a user from an online platform, forum, or computer game.
Wegen wiederholter Regelverstöße erhielt der Spieler einen permanenten Ban.
Because of repeated rule violations, the player received a permanent ban.

ban
Loading your saved state.
ban
A block or exclusion of a user from an online platform, forum, or computer game.
Wegen wiederholter Regelverstöße erhielt der Spieler einen permanenten Ban.
Because of repeated rule violations, the player received a permanent ban.

The two meanings of 'Ban' are very different. The context makes it clear what is meant: if it is about the internet, games, or social media, it refers to a ban. In historical texts about southeastern Europe, it refers to the noble title.
Er hat einen Ban für das Forum bekommen, weil er die Regeln missachtet hat.
He got a ban from the forum because he ignored the rules.
In the meaning of 'Sperre' (ban/block), 'der Ban' is a loanword from English. It belongs to the word family of the German verb 'bannen' (to banish or exclude someone).
Der Administrator kann Nutzer bannen, die Spam posten.
The administrator can ban users who post spam.
In online contexts, 'Ban' is often combined with certain verbs. Typical phrases are 'einen Ban bekommen' (to get a ban), 'einen Ban erhalten' (to receive a ban), or 'einen Ban haben' (to have a ban).
Nach drei Verwarnungen hat sie einen permanenten Ban bekommen.
After three warnings, she got a permanent ban.
The word 'Ban' in the meaning of 'Sperre' (ban/block) belongs to colloquial language and the jargon of internet and gaming culture. In more formal texts, you would more likely find 'Sperre' (block/ban) or 'Ausschluss' (exclusion).
Mein Account hat einen 24-Stunden-Ban.
My account has a 24-hour ban.
ban / prohibition
'das Verbot' and 'der Ban' can both mean that someone is no longer allowed to do something. 'Verbot' is the general German word for an official rule: something is not allowed. 'Ban' is used mainly on the internet, in forums, on platforms, or in computer games. It usually means that a user is blocked or excluded. The words can be confused because a 'Ban' works like a 'Verbot'. More natural usage is: 'Verbot' for rules in everyday life and in laws, 'Ban' for online exclusions.

Nach mehreren Beleidigungen bekam der Spieler einen Ban im Online-Spiel.
After several insults, the player received a ban in the online game.
Das Verbot von Handys während der Prüfung gilt für alle Teilnehmer.
The ban on mobile phones during the exam applies to all participants.