You have six cases in Russian: the nominative, accusative, genitive, instrumental, dative and prepositional. Remember they are all used at varying popularities, so the dative case is not nearly going to be used as much as the accusative or genitive case!
The nominative case is quite simple, just the ‘starting’ point of a sentence which is why many sentence constructs involving verbs use the nominative pronouns. ‘I write’ ‘I play’ ‘I read’. Such as ‘the student reads the newspaper’. When in doubt, generally, use the nominative case!
The accusative is the direct object of a sentence. Commonly a noun which the action is being done onto. ‘I put the book on the table’, book being the object of the verb. ‘I read the book’ or ‘I meet the friend’. Luckily the masculine accusative and nominative forms are the same, so no need to be too worried about that!.
Genitive is the possessive case and in the English language replaces the preposition ‘of’. ‘That is the house of Ivan’. Or even literally ones, ‘the bank of the river’, bank would be in genitive. Literally the bank belongs to the river.
Prepositional describes if something is at the location. So instead of just talking about the location, the preposition indicates that the subject is at the location. ‘Ivan is in London’ rather than ‘Ivan is going to London’, the latter would be in accusative because London has become the object of the verb.
Dative is the changed noun of which an action is being done onto ‘I gave my phone to him’. ‘To give a piece of advice to them,’ or to ‘help someone’. Or ‘Help me’. ‘I am happy at the sun.’ The accusative and dative case can often get confused, but the dative is the recipient of an action and the accusative is the noun being done onto by a verb, voluntarily or not!
Instrumental is the case which describes what an action is being done with (like the instrument of your action!). So if I wrote a letter with a pen, the pen would be the instrument of my writing. Or the sentence ‘I went by train’; lit ‘I went with train’ the journey was completed with the instrument of a train.
Also this case follows the preposition ‘with’ in any sentence. So when you say ‘I went to the cinema with my friends,’ friends would be in the instrumental case. You are literally translating it as ‘It was with my friends that I went to the cinema’ – or, your friends are the instruments of enabling you to go to the cinema.
Ultimately the case system of Russian is very complicated and different to the English sentence structure. So there is no single formula which will guarantee you will make correct use of them every time, nor quick route to master them! if you struggle with it, it’s good! Because even Russians’ themselves find it difficult. Just keep learning set phrases to use the cases with (like I go with my friends (instrumental) and, eventually, it’ll start to come much more naturally.