When your controller flashes yellow it means it is connected but only for charging and this can be a problem as you can not use it for anything else.
How To Fix PS4 Controller Can’t Connect | Flashing Yellow Light On PS4 Controller
So, how can we solve this problem? The easiest way is to turn off your controller and your PS4 by holding down the power down button and this will turn off the controller as well.
If the controller is not off, hold down the PS button. Then unplug the power cord from your PS4. Then use a pin or toothpick to click on the hole on the back of the controller, this will restart the controller.
Then, take a USB cable and connect the controller to your PS4. If the yellow color is still flashing, press the PS button repeatedly without stopping.
If it is not connected to a USB cable. Put the controller in Sync Mode and it should connect it to your PS4. Try disconnecting and reconnecting your controller from your PS4.
You can also try toremove your PS4 controller from other connected devices. Turn on PS4 in safe mode, reset the console or try replacing your Dualshock 4 cable.