I was wondering how can I play music on hifi through speakers and headphones at the same time?

Answers

G. Whilikers

Check your system for RCA outputs that would go to an external pre-amp or tape deck. This would be a good place to grab the audio for a headphone specific amplifier, mixer, Bluetooth transmitter, etc. Keep in mind the output may not be volume-controlled.

spacemissing

All decent receivers and integrated amplifiers allow that: The headphone jack is active at all times and doesn't switch the speakers off when a plug is inserted. If you are dealing with a unit that switches the speakers off, replace it with a good one.