I have uploaded these tutorials on this topic to this community, you may be interested in taking a look.
Arduino + Bluetooth HC-06
Arduino + Bluetooth HM-10 BLE
ESP32 - BLE (Bluetooth)
ESP32 - WiFi.
ESP32-CAM
ESP32 - MQTT
ESP8266 - WiFi