Ranitidine or omeprazole whats better


I am looking for drugs for my heartburn. Which is drug is best ranitidine or omeprazole? and Why?
Are there any risks involved if I use these drugs long term? I checked on google and found " Prilosec ( omeprazole ) gives you long-lasting heartburn relief but has some risks if used long term"

Please clarify if you have any idea?