You don’t have to spend a fortune on a good bike, but spending money on a bike fit will repay itself just minutes into your first long ride.
You will be more comfortable, have better technique, prevent injuries and get more power from your legs. It is worth every penny, particularly if you do not have an “average” body. I am 6’5″ and it’s hard (almost impossible) to get a decent bike within my budget, so I invested in a bike fit to help my money go further.
If you are going to get one done, make sure you spend your money wisely and maximize the value. Here’s a decent, quick summary from Active with tips on getting your bike fit.