While driving home in my neighbor I was approaching vehicle ahead of me which was stopped. I applied the break pedal which went loosely all the way to ground and unresponsive. Due to my inability to stop on time I rear ended the vehicle. No warning that there was an issue with my breaks what so ever. The only thing that I did have going on was my trucks front panel (gauges & stereo screen) weren't functioning. I went to turn on my pick up and it behaved as if battery was dead. I let it sit for a few minutes and attempted to start it once again and it started right up. The issue was the stereo screen stayed black and only the fuel gauge and speedometer were functioning. In the end I ended up being at fault in the accident and reported it to my insurance.