If you put diesel in a petrol car, the engine will not be able to properly combust the fuel. This will cause the engine to run rough, stall, and produce excessive smoke. In some cases, it can even damage the engine.
If you accidentally put diesel in your petrol car, you should stop driving immediately and have the fuel drained from the tank. You should also have the fuel system flushed and the engine serviced to remove any residual diesel.