Uber and Lyft both have had their share of criminal behavior either with an Uber or Lyft driver or someone posing as a driver. If you follow all the safery features in the Uber and Lyft app that will prevent you from getting into a car that is not your Uber or Lyft.
5 R'S (Rights)
Right License plate
Right profile pic
If even one dont match what you are seeing in your rider app DO NOT GET IN THAT CAR. Leave the area and get to a safe place. You can contact Uber or Lyft later to get your cancel fee back.
You can also watch the Uber or Lyft car pull up to your pick up location on your app.
Once your trip is accepted by the driver both companies assign a generic number for you to contact the driver or the driver to contact you. Here are two more ideas if you still do not feel safe.
Call your driver when he/she pulls up. If their phone dont ring or they dont answer its not your driver.
You can go a step further, once a driver accepts your request text them a word or small phrase. When he /she pulls up ask them what the text said.