Need 25 Pin as out put 2 pins for sensor & 23 for Relays

You have a style of asking as if you would ask "can somebody post the cheat-code for reaching platinum-level"

Which could be answered with a 10 digitnumber and everything is done.
So the short answer is "use IO-expander" - end of message.

Though this does not help very much.
Maybe my guessing is wrong but you seem to be in a hurry to finsish this project.
Well - speeding up finishing your project works this way:

of course you are free to decide to ignore this advice and start waisting time on
trying to hurry down the road. Just to recognise later the hurrying up slows me down
best regards Stefa