To keep fighters going the sword and shield path, shield bashing is a useful attack for how to do it in Mount and Blade II: Bannerlord. It ensures that your defensive strategies remain as powerful as your offensive strategies, and if you know how to protect the bash, you can unbalance your enemies during a fight.
You don't need to spend hours trying to get it to work. The process of performing a shield hit is exceptionally straightforward. All you need to do is have a shield in your hand, to make sure you have a shield to hit your opponents. When you hold it and enter the battle, hold it to block by pressing the right mouse button or the keyboard shortcut that you linked to your block mechanic. While you're holding it to block, press the E key on your keyboard like you're about to kick, and you'll push your shield forward.
The technique staggers your opponent and pulls him away from you. It doesn't do much damage. Still, if you want to stay defensive while fighting and have more reliable technique than others while fighting multiple opponents, the bash shield is a reliable mechanic. If you want to increase the damage of the technique, there are two perks under the one-handed skill tree, and you can give them to your character to make them more powerful. These include Shield Bash I and Shield Bash II. There are other perks in the tree that increase your defensive effectiveness of holding a shield, further developing your defensive traits as a sword and shield player.
Alternatively, for those who would rather hold a single weapon in one hand instead of using the shield in the other, you are free to do that, too. There are several perks in the One Handed Tree that you can choose from.