Can I use magic gifted by a deity if I’m not a paladin, warlock, or cleric of that deity?


So, I’m wanting to create this homebrewed God called "The Crow Lord" (basically a less depressing and edgy version of the Raven Queen) and I’m fairly new to D&D and I’m a bit confused. My little-to-no experience in D&D has told me one thing (mainly my DM saying it): that you can’t be a servant/follower of a deity unless you’re a warlock, paladin, or cleric of that deity. Is that correct?

Can I still use the magic gifted by the deity if I’m not a paladin, warlock, or cleric belonging to it? Or can you only worship a god and have your spells centered around that god (i.e. get in-game benefits like spells or buffs from that deity) if you’re a cleric, paladin, or warlock?