In the first picture... that is your ABS sensor. The sensor is held down in place by a hex head bolt.
In the second photo... that looks like your brake pad sensor. looks like someone(a previous mechanic maybe (?) who did a brake job) just cut off the old pad sensor - and left those red and yellow wires hanging liek that. Not sure why he wouldn't have just unplugged the old sensor. ?
A new pad sensor will clip onto your brake pads, then the wire snakes out of the brake caliper and to a connector that up at that WHITE clip/bracket.