how to send sensor data from one lora module to another

I have connected a motion sensor to lora module connected to Arduino mega and want to send sensor data from one end to advice on the subject

You will need to install a library that allows the Arduino to send and receive data via the LoRa device.

There is a worked example for a sensor transmitter and receiver, using the SPI LoRa devices here;

See example programs 17 and 18.

There are LoRa devices that have a serial front end so that you can send and receive data in the same way as you would through the Serial monitor, no real need for a library in this case.

Have a look at the RadioHead library. Very easy to use, works with many different radios.

Another library that works well for me with point to point LoRa is here.