For example, if you want to get a random user you can write the following code and it will return one random user.
Using Collection random() method
The 2nd way is to use the "random()" method of the collection instance and this way will retrieve all of the records and randomly get the record/instance.
Using orderByRaw() method
The 3rd way is to use "orderByRaw()" method and it will accept raw SQL function. If you are using PostgreSQL then the raw SQL function will be "'RANDOM()'"