How to use an existing game legally for inspiration?
Welcome to the awful world of copyright, intellectual property, license and patent.

First of all, a game is not an invention: you can't patent it. Taking inspiration from another game would be a problem of intellectual property.

Intellectual property is a very fragile notion. In fact, in most countries, taking the character of Pikachu, making it blue with green stripes and calling it Mikichu is legal, because it's not the same character. I'm not sure you want to do that anyway: that would be taunting Pokémon and they would probably take legal measure against you anyway. (I'm sure their lawyers already know how).

Then, if it is for some sort of mechanics, don't worry. There are plenty of games that share the same mechanics:


Rolling 2 dice and using the mathematical property that 7 comes out more often is used in Catan and Can't Stop.
Being forced to draw a negative card at the end of the turn is used in both in Pandemic and Shadow over Camelot.
Building the board as you play is used in both Carcassonne and Takenoko.


And if you still have a doubt about what I'm saying, I only have two words for you: "Mafia" and "Werewolves". These games are literally the same with a slight difference.

To be sure you are not accused of stealing anything, it's exactly like when you write a book or an essay: cite your sources. Add at the end of your rulebook: "Thanks to Monopoly for the inspiration", or even better "If you liked this game, make sure to try Monopoly, from which I took my inspiration". The creator of the other game will be thrilled to have free publicity. Most game creators don't do that (because it's not at all something required), but if you feel it that way, please yourself!