nearly rear ended someone

was out doing practice today and i had driven like 2 hours straight and i looked away to read a road sign then i got distracted and literally had to emergency stop. drove the whole way back in silence, test is booked for may but genuinely cancelling it after that bcs how am i ever gonna be trusted on the roads even if i somehow pass. ive been driving since december and had like 50 hours practice and 20 hours driving lessons