How to take or edit quality photos such as these?

I follow some people on instagram who post the most amazing photos I've ever seen of their dogs.
For example:
https://instagram.com/...rfoxshots/
https://instagram.com/...ya.sydney/
HOW on earth do they edit or take them? Is it the lens? I have a 5ish year old Nikon d40. Is there anyway I can take such quality pictures?

I answered your other question relating to this, but just to add…
How you learn photography basics depends on your style of learning - there are online tutorials, college classes or what I recommend is joining a local camera club. There you can meet other photographers, get tuition, learn new techniques and most importantly, get meaningful feedback on your work.

How to take? Study photography.
How to tweak pictures to look like that? Study photography first then study image manipulation.
OR
Use a camera phone and some popular app out there.