Yes, anyone can write a book! If you have an idea, write it!
If your only goal is to finish a book, check out nanowrimo.org for inspiration and support just for to force yourself to write and keep writing!
If you want to publish it, self-publishing is surprisingly cheap, if you’re happy if you only sell a few hundred copies, many just to friends and family.
If you want to publish a real novel that appears in bookstores and gets featured and advertised, you need to submit it to publishers…and be prepared for LOTS of rejection. Some of the BEST novelists I know write 10 books for every 1 they get published. Now imagine the worst writers!