If a player is misbehaving in some way, Badminton umpires have four ways to react:
Umpires can issue a verbal warning. In case of delay (the most common infraction), umpires repeat the score in minor cases, and add a Play announcement to signal the second level of warning. At the next level of escalation, umpires will ask the player to come to the umpire chair in order to talk to them. A couple of common warnings are formalized in the vocabulary, for example You must not delay the game, but umpires can be more precise if necessary. As a final warning, umpires sometimes point to their cards or inform the player that a card is imminent.
In case of a repeat offense after a major verbal warning, or a more major offense (e.g. seeking coaching input while the shuttle is in play, or throwing the racket without endangering anyone), the umpire will show a yellow card, and announce why§5 Vocabulary. A yellow card has no effect at all apart from a monetary penalty: In international play, the third yellow card in a year costs 500$; all subsequent yellow cards 250$. National regulations may vary - for example, in the German Bundesliga it's just 50€. Every side can only be shown one yellow card per match. In case a side has already been shown a yellow card but still commits an infraction, a red card will be shown.
A red card is also called fault for misconduct. The opposing side gets one additional point, as if they'd won a rally. Apart from repeated infractions (a yellow-worthy offense after a yellow card), major offenses such as cussing at the umpire/opponent, throwing a racket anywhere near people, not showing up after an interval etc. are cause for a red card. A red card also comes with larger fines, 500$ at international levels. The umpire will also call the referee to discuss whether a black card is in order.
If referee and umpire agree to disqualify a player, the referee will hand a black card to the umpire, and the umpire can then show it to the player in question. Black cards are only shown for very major infractions, such as losing intentionally, hitting opponent or umpire with the racket and the like. A black card entails disciplinary action by the BWF or national federation.
For more information about the procedure and infractions, refer to the Instructions to Technical Officials(ITTO) and §16 of the Laws. Note that all kinds of warnings can also be handed out before or after the matchITTO 5.17.10, for instance when a player misbehaves upon losing.
Bear in mind that Badminton players are usually good sportsmen. Cards are very rare compared to other sports. At national levels, tournaments will often finish without a single card. At international levels, I estimate that cards are only shown in about 1% of matches. In particular, black cards are exceptionally rare - the last one at international levels dates back to 2013.