put the cart before the horse
verb
°To put things in the wrong order or with the wrong priorities; to put something inconsequential as more important than something more essential.
synonyms: ass-backwards