Hint!! If you are an android user like I am, downloading a German keyboard is not neccesary. Simply press the capitalize button, and hold on the letter "O" for more options on that letter (Ø,Œ, Õ,Ò,Ó,Ô,Ō and Ö.) Saw quite a few complaints on this fact on other Flags like this one.
I am using Gboard and instead of adding a normal QWERTZ keyboard for German only, I have a multilingual “German” keyboard (German, French, English as I made in settings). That keyboard has ä, ö and ü independent; it means I don‘t have to long press on “O” to choose “Ö“, but have to long press on s to choose ß, or from text suggestion I choose the correct word. I’m bad at explaining, so I’ll let these screenshots explain:
On a telephone, a long press on, say, "a" will give all the "a" character options (à,â,ä, etc).
On a mac, a long press on the "a" will give a similar result, I don't know about a windows computer, read clogva1's comment.
You just have to learn it.
When you come across a new word, look it up in the dictionary to find out its gender, and then memorise not Öl = oil but das Öl = the oil so that you will remember that Öl is neuter.
There's basically no logic behind noun genders in German.
(Sometimes, the same word can even have different genders in different parts of Germany! Though usually only one of those will be considered standard.)