Dear student
By applying a potential difference across the capacitor.
Let initially the plates of the parallel plate capacitor are at the same potential say zero. Then the capacitor attached to a battery. Now the one plate of the capacitor is connected to a positive potential (positive pole of battery) and second plate is connected to a negative potential (negative pole of battery). due to potential difference the elctrons flow from negative pole of battery to the second plate of capacitor and first plate of capacitor to positive pole of battery. This process of flowing of electrons continue until the potential of the second plate & negative pole and first plate & positive pole becomes same.
Now at this time the first plate has a positive charge and in the same amount second plate has a negative charge. Then we say that capacitor is charged.