You should always buy the best camera in the world ...and the best camera in the world, is the one you have with you :) Of course some camera models will give you a better result, but if they aren't with you they are useless.
Many people equate buying a camera with choosing one of two options - either buying an SLR or buying a cheap compact if price is a factor. The truth is that cameras have evolved not just in how good either one is, but also, new technologies have bred entirely new categories of cameras.
Another complication is that many of us have capable camera phones with us at all times. Do keep your phone in mind when making a decision of what camera to buy since the camera should give you something that your phone doesn't. Otherwise, what's the point of carrying another device?
"The Digital SLR" - a photographer's choice
So lets start off talking about the white elephant in the room - The venerable Digital SLR. This is the most misunderstood camera on the planet, and yet the obvious choice if you are intending to take up photography as a serious hobby, or start working as a professional photographer. SLRs tend to have a better build than other cameras and can suffer a bit more use and abuse. Since they have a large sensor (roughly the size of an SD card) they take beautiful photos, and they have one feature you won't find on any other consumer camera type: an optical viewfinder that shows you exactly what the lens is seeing. This last point is the reason an SLR is so important for photographers: instead of looking at a screen, you are looking into the scene with your eye and the experience is completely different. Top dogs in the SLR world are Canon and Nikon, pop over to the respective dealers and see which one feels best in your hands and go for it. The most important things to keep in mind when buying an SLR:
Do not buy anything except the camera and a lens. Ignore the 99-in-1 super duper thingy that does everything and the double kit magic zoom etc. Many times you are only saving a small amount and ending up buying a lot of useless doodads that you don't really need. Buy the camera, with the kit lens and take some pictures - once you figure out what you enjoy shooting you'll have a sea of other things you can buy.
I personally shoot Canon, and if you are aspiring to become a working photographer - the Canon 5D Series of cameras are (in my humble opinion) the perfect sweet-spot of price-ruggedness-reliability and specs
"NOT a dSLR" - everyone else's choice
If you are not aspiring to become the next Helmut Newton, there is a high chance that you won't even use this lovely viewfinder. Even worse than that, you will start to leave your camera at home because of the worst characteristic of an SLR: they are huge and heavy, even I don't like running around with one when I'm not working. Don't underestimate how many people buy one of these cameras and then never use it once the novelty has worn off.
Beautiful Photos - Small Camera - Changeable Lenses
Great image quality (and I mean the kind of quality that can be printed in a magazine, ie as good as an SLR, sometimes better) can be found on 2 other types of cameras, high end compact cameras and my personal favourite, mirrorless Cameras.
These cameras have great image quality for a very good reason, some of them use the exact same sensor as the ones that can be found in great SLRs. For example, the Sony NEX 5n (~600 Euro), which is a rather old mirrorless camera, had the same sensor found on the Nikon D7000 (~1000 Euro). That means that these cameras produced images which are very very very similar.
The only difference is that the NEX is much smaller and only around a third of the weight of the D7000. Oh, and it's around 400 euros cheaper too. This particular mirrorless camera is missing the viewfinder, but for many people this is a useless feature anyway. If you dont particularly care about a viewfinder, Canon has just launched the new M100 camera which is getting great reviews: https://www.dpreview.com/products/canon/slrs/canon_eosm100
Mirrorless SLRs are basically SLRs that have had their mirror and optical viewfinder removed. The light hits the sensor at all times and the back screen (or in some models a digital viewfinder) is used to take the shot. I personally have a mirrorless SLR that i use when not carrying my 5D, however not everyone has the same tastes and new models come out yearly. Www.dpreview.com has a great buying guide for mirrorless cameras here: http://www.dpreview.com/articles/6428641287/mid-range-mirrorless-camera-roundup .
If the latest models are outside your budget, find one that's a year or two old, this class of camera depreciates quite quickly.
Beautiful Photos - Smaller Camera - Integrated Lenses
The last type of camera i'll recommend is the premium compact camera. When these guys were getting shrunk, the boffins doing the shrinking reasoned that if they remove the ability for the user to change lenses, it will result in an even smaller camera... and that's exactly what they did.
Some of these cameras use a sensor that's the same size as that found on an SLR, image quality will be great. The lens you get with these type of cameras can vary from "meh" to "OMG". For example, if you look at the 24-70mm f1.8-2.8 lens that you get on the Sony RX100 (mk3 & mk4) it's much better than anything bundled with an SLR (or mirrorless camera for that matter). A good 24-70mm f2.8 lens (the one above is even better since it has f1.8 - which means it can work in much darker environments) can cost upwards of 2000 Euros. Just the lens. Really. The Canon PowerShot G9 X Mark II is also a great choice
The only downside to premium compact cameras is that some have a sensor that's a tiny bit smaller than an SLR and their handling and responsiveness may suffer due to the small size. These areas are constantly being improved on, however it's best to see how a particular camera handles (by reading reviews) before pulling the trigger. A great guide for buying a high end pocket camera is available on dpreview.com: https://www.dpreview.com/reviews/2017-roundup-compact-enthusiast-zoom-cameras