Actually I am confused between get and be as there are so many sentences in which get can be replaced with b without changing their meaning. So I just want to know what are the differences between get and be? And when can I interchange them without changing the meaning of the sentence?
In many contexts to get (followed by [adjective] or Past Participle] used adjectivally) is simply an equivalent alternative to to be [ADJ]. But note that to some speakers in some contexts, it will be seen as a somewhat "colloquial" usage that should be avoided in formal contexts.
If the "adjectival PP" element refers to an "internal" state, rather than the result of the subject being acted upon by an external agent, the get form isn't usually very idiomatic...
1: If I fail I will be disappointed - natural English)
2: ? If I fail I will get disappointed - an "unusual" construction
I'd say the reason for that is because to get [verbed] more strongly alludes to undergoing the process of being "verbed", whereas to be [verbed] normally references the end result [of having been "verbed"]. So if we compare...
3: The turkey will be cooked at midday tomorrow
4: The turkey will get cooked at midday tomorrow
...I'd say #3 is more likely to carry the sense of the cooking process being finished (that's when the turkey will come out of the oven and be ready to eat), whereas #4 is more naturally understood as a reference to when it'll go in the oven (and start to be cooked).
The second "distinction" given above is perhaps easier to see with continuous verb forms...
5: Please put the children to bed. They're being tiresome1
6: Please put the children to bed. They're getting tiresome
...where #5 is more likely if the children have been "acting up" for some time, but #6 more strongly implies they're just starting to become unruly.
1 Arguably my first distinction above is undermined by the fact that They're being overexcited isn't very idiomatic here, whereas They're getting overexcited is perfectly natural. Maybe this reflects a third distinction, whereby we avoid two consecutive instances of [TO BE] in favour of plain They are / They're overexcited, unless the context strongly implies some outside agency currently causing the altered state. For example,...
7: They're being overexcited by Grandpa, who's getting a little drunk and playing boisterous games with them.
Get has many meanings, one of those is become.
This is different than be. When you say X gets Y or X becomes Y, you are concerned with both the previous and current state of Y and you are also expressing that a change is happening.
When you say X is Y you don't have a concern with any previous state, and aren't trying to say anything is changing.