To build a motion detection system using Raspberry Pi and Twilio WhatsApp API, one needs to set up a Raspberry Pi with Raspbian OS, connect an infrared motion sensor (HC-SR501) to it, configure the sensor's settings, and create a Python script that reads data from the sensor. The script uses GPIO to access the sensor pins, time to add delays, and Twilio to send WhatsApp notifications when movement is detected. After setting up the hardware circuit, one needs to configure the Twilio WhatsApp Sandbox settings and initialize the Twilio client with account credentials. The script then listens for events from the GPIO pin, checking if the sensor detects any movement, and sends a message to the WhatsApp number whenever motion is detected.