In Leviticus 27, the Lord explained how the Israelites could redeem something that they had dedicated to the Lord.
In Number 8, the Lord explained that rather than taking the firstborn of all Israel for Himself, He did something else instead,
“[The Levites] are wholly given to Me from among the children of Israel; I have taken them for Myself instead of all who open the womb, the firstborn of all the children of Israel” (Numbers 8:15-19).
He said that He sanctified them on the day when He struck the firstborn of Egypt, and that He had given the Levites to Aaron and his sons to help in the work of the tabernacle, and this was all to prevent Israel from suffering by a plague when they approached the sanctuary.
God wanted His people near Him, but He also realized that their sin prevented the experience from being all that it could be. Therefore, He made provision to bring His people near to Him.
It is for this very reason that the Father gave His Son to the world, that we might have access to the Father and be able to experience fully our relationship with Him.