It can be generated by treating potassium hydroxide (or other potassium bases) with hydrochloric acid:

  
    
      
        
          KOH
          +
          HCl
          ⟶
          KCl
          +
          
            H
            
              2
            
            
              
            
          
          O
        
      
    
    {\displaystyle {\ce {KOH + HCl -> KCl + H2O}}}
  This conversion is an acid-base neutralization reaction.
Another method would be to allow potassium to burn in the presence of chlorine gas, also a very exothermic reaction:

  
    
      
        
          2
          
          K
          +
          
            Cl
            
              2
            
            
              
            
          
          ⟶
          2
          
          KCl
        
      
    
    {\displaystyle {\ce {2 K + Cl2 -> 2 KCl}}}

References
Further reading
Lide, D. R., ed.