I’m a bit new to Japanese and I’m a little confused about what they are used for.
The latter are quotation marks, equivalent to " " in English. For example, the sentence:
Mr Tanaka said "Good morning".
could be written as something like:
The former may be a little different in different contexts, but one way it's used is to lengthen vowels when you write words in katakana. So, for example, the word for Australia, "Oosutoraria", is written as
Note that when you write text vertically (as is traditional in Japanese), the vowel lengthening symbol is also written vertically (｜).