It is important to understand the issues and trade offs.
For example, frequency response and dynamics, spill (important when it comes to sharing your "live room" and "control room", as most home studios are combined with a budget limiting gear available), and the rarely mentioned topic of ear fatigue.
Frequency response. The bass response of headphones is quite different to that of speakers. In fact exactly how they get your ear to hear bass is entirely different. This means that using headphones (worse - ear bud! Noooooo.....) can really color your mix... It'd skew the frequency volumes.
Dynamics, yet again we also feel bass, particularly sub-bass. Headphones either omit sub-bass or reconstruct it using harmonic frequencies to fake it inside your ear. Bass frequencies (particularly sub-bass have long wavelengths, which even monitors cannot reproduce exactly, but they are a hell of a lot closer than what headphone speakers can achieve.
Use headphones for a rough mix, a detailed idea of stereo image, but not final mixes. Better if you use headphones (or "cans" as they are also known) for monitoring during recording rather than mixing and only to check minimal aspects of the mix.
when you record mix and perform in the same space, spill is very important. Specifically applied to cans it is when the sound coming from headphones "spills" from just your ear hearing it, to being picked up by the microphone. Apart from a less likely "feedback loop" it can cause havoc come mix time. Imagine the general early recording mix spilling on the vocal track, especially the snare. You want to have the vocals out front but in doing so now it boosts the snare sound whenever the vocal track is not muted. Worse if you decide to remove the drums in one section during mix, only now you can't remove it because the drums can also be heard on the vocal track... And that is just one scenario using one instrument spilling.
To combat this cans come in 3 varieties: open back, closed back and semi-closed back.
Closed back cans cut spill to the minimum, BUT they color the mix more by skewing the frequency response of the headphone speaker, meaning you hear something that is far from a true representation of the frequencies in the music... Or at least significantly different. For this reason closed back cans are best suited to being word by the musician who is being recorded. They do not care about such details of frequencies but you want to minimise spill.
Conversely open back cans minimise coloration of sound, but have a lot of spill, and I mean a lot. This type of can is best suited to mix and mastering engineers who have a dedicated control room, with the musician being recorded in another room (only an issue for mic-ed sources)
Semi-closed cans are a halfway house. They have significant spill, but less than open cans, and the color the sound, but less than closed back cans.
Ear fatigue. Closed back cans are often avoided by mix engineers, even when they are in the same room as the source because of ear fatigue. Ear fatigue is a phenomena where your brains perception of sound is interfered with... Not because it is bored, but because of the mechanics of the inner ear. Without going into detail here, it is enough to know that after a while of working with sound what you hear actually changes... Which skews mixes lots!
The closer the speaker, the sooner ear fatigue kicks in and the worse it will be. Worse again, closed back cans make the problem even worse. Much worse than open back cans. Pro engineers cannot afford to screw up mixes, or to have ongoing "tired" ears. Do not underestimate how much it will screw up your mixes!
On a budget, monitors are essential to good mixes, especially during long sessions.
Equally at least one pair of closed cans is essential. They do not need to be brilliant in any other way than reducing spill... So check that. Get a friend to try them to get an idea of suitability by seeing how much spill there is.
However,, a pair of open back cans is really useful if you record and mix loads, and a good pair of semi-closed can be a useful compromise if you can only afford one decent pair for the engineer. If you record yourself mostly, get a pair of closed and a pair of open... Ideally all 3 options are useful.
I know, you want to hear: do this. You also want to hear it is just one purchase.... And initially it might be. But your ears are essential tools, AND you don't want to have crap mixes and wonder why (having read this of course that will not be the case ), so plan at least to purchase the missing bits asap, and know the initial trade offs if you limit to buying just monitors and one pair of mixer cans (crap old cans for anyone else!). Try very hard not to work with only cans. It sucks. It is impossible to work with only monitors!