To program the Onesto PTS15A digital programmable timer switch for a swimming pool motor, first, connect the timer to the power supply and the motor. Then, press the "Prog" button to enter programming mode. Set the desired on and off times for the motor using the hour and minute buttons, confirming each entry. Finally, exit programming mode, ensuring the timer is set to "Auto" to automate the motor operation according to your schedule.